/* ── Hashtag Technology HRMS — site.css ── */

:root {
  --primary:   #1B3A6B;
  --accent:    #2E75B6;
  --accent2:   #C00000;
  --sidebar-w: 260px;
  --topbar-h:  60px;
  --bg:        #F0F4F8;
  --card-bg:   #FFFFFF;
  --border:    #DEE2E6;
  --text:      #1A1A2E;
  --text-muted:#6B7280;
  --success:   #28A745;
  --warning:   #FFC107;
  --danger:    #DC3545;
  --radius:    10px;
  --shadow:    0 2px 12px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); margin: 0; }

/* ── SIDEBAR ── */
#sidebar {
  position: fixed; top: 0; left: 0; width: var(--sidebar-w);
  height: 100vh; background: var(--primary); color: #fff;
  display: flex; flex-direction: column; z-index: 1000;
  overflow-y: auto; transition: transform .3s ease;
}
#sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand-logo {
  width: 160px; height: 48px; flex-shrink: 0;
  background: #fff url('/images/logo.svg') no-repeat center / contain;
  border-radius: 8px; padding: 5px 8px;
  font-size: 0;
}
.logo-h { display: none; }
.logo-t { display: none; }
.brand-name { display: none; }
.brand-sub  { display: none; }

.sidebar-user {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 8px;
}
.user-avatar {
  width: 36px; height: 36px; background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.user-name  { font-size: 13px; font-weight: 600; display: block; }
.user-role  { font-size: 10px; color: rgba(255,255,255,.6); }

.sidebar-nav { list-style: none; padding: 0 12px; margin: 0; flex: 1; }
.nav-section {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(255,255,255,.4); padding: 14px 10px 6px; margin-top: 4px;
}
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  color: rgba(255,255,255,.75); border-radius: 8px; text-decoration: none;
  font-size: 13.5px; transition: all .2s; margin-bottom: 2px;
}
.sidebar-nav .nav-link i { width: 18px; text-align: center; font-size: 14px; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--accent); color: #fff; font-weight: 600; }

.sidebar-footer {
  padding: 16px; border-top: 1px solid rgba(255,255,255,.12);
}
.btn-signout {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 14px;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); border-radius: 8px;
  text-decoration: none; font-size: 13px; transition: .2s;
}
.btn-signout:hover { background: var(--accent2); color: #fff; }

/* ── MAIN CONTENT ── */
.has-sidebar #main-content {
  margin-left: var(--sidebar-w); min-height: 100vh;
  display: flex; flex-direction: column; transition: margin .3s;
}
.topbar {
  height: var(--topbar-h); background: var(--card-bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 100;
}
.sidebar-toggle { background: none; border: none; font-size: 18px; color: var(--text-muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.sidebar-toggle:hover { background: var(--bg); }
.topbar-breadcrumb { flex: 1; font-size: 14px; color: var(--text-muted); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
#notif-bell:hover i { color: var(--primary) !important; }
#notif-panel { font-family: 'Segoe UI', system-ui, sans-serif; }

.content-wrapper { padding: 28px; flex: 1; }

/* ── PAGE HEADER ── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 { font-size: 1.6rem; font-weight: 700; color: var(--primary); margin: 0; }
.page-header .page-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); border-left: 4px solid var(--accent);
  display: flex; align-items: center; gap: 16px;
}
.stat-card.red    { border-color: var(--accent2); }
.stat-card.green  { border-color: var(--success); }
.stat-card.yellow { border-color: var(--warning); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px; background: rgba(46,117,182,.12);
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--accent); flex-shrink: 0;
}
.stat-card.red    .stat-icon { background: rgba(192,0,0,.1); color: var(--accent2); }
.stat-card.green  .stat-icon { background: rgba(40,167,69,.1); color: var(--success); }
.stat-card.yellow .stat-icon { background: rgba(255,193,7,.12); color: #856404; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ── CARDS ── */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 20px;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: transparent; border-radius: var(--radius) var(--radius) 0 0;
}
.card-header h5 { font-size: 1rem; font-weight: 700; color: var(--primary); margin: 0; }
.card-body { padding: 20px; }

/* ── TABLE ── */
.table-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table thead th {
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px; padding: 12px 14px; border: none;
}
.table tbody tr { transition: .15s; }
.table tbody tr:hover { background: rgba(46,117,182,.05); }
.table tbody td { padding: 12px 14px; vertical-align: middle; font-size: 13.5px; border-bottom: 1px solid var(--border); }

/* ── FORM ── */
.form-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-section { padding: 0 24px 16px; }
.form-section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  color: var(--accent); border-bottom: 2px solid var(--accent); padding-bottom: 6px;
  margin: 24px 0 16px;
}
.form-label { font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 5px; }
.form-control, .form-select {
  border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; padding: 9px 12px;
  transition: .2s; color: var(--text);
}
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46,117,182,.12); outline: none; }
textarea.form-control { resize: vertical; min-height: 90px; }

/* ── BUTTONS ── */
.btn { border-radius: 8px; font-size: 13.5px; font-weight: 600; padding: 9px 18px; transition: .2s; }
.btn-primary   { background: var(--primary); border: none; color: #fff; }
.btn-primary:hover   { background: #1a3560; color: #fff; }
.btn-accent    { background: var(--accent); border: none; color: #fff; }
.btn-accent:hover    { background: #2563a0; color: #fff; }
.btn-danger    { background: var(--accent2); border: none; color: #fff; }
.btn-sm        { padding: 5px 12px; font-size: 12.5px; }
.btn-icon      { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; }

/* ── BADGES ── */
.badge { font-size: 11px; padding: 4px 9px; border-radius: 20px; font-weight: 600; }
.badge-pending    { background: rgba(255,193,7,.15); color: #856404; }
.badge-approved   { background: rgba(40,167,69,.15); color: #155724; }
.badge-rejected   { background: rgba(220,53,69,.15); color: #721c24; }
.badge-active     { background: rgba(46,117,182,.15); color: var(--primary); }
.badge-won        { background: rgba(40,167,69,.15); color: #155724; }
.badge-lost       { background: rgba(220,53,69,.15); color: #721c24; }
.badge-role       { background: rgba(255,255,255,.15); color: rgba(255,255,255,.85); font-size: 10px; }

/* ── PIPELINE KANBAN ── */
.pipeline-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.pipeline-col {
  min-width: 220px; background: var(--bg); border-radius: var(--radius);
  border: 1px solid var(--border); flex: 1;
}
.pipeline-col-header {
  padding: 10px 14px; font-size: 12px; font-weight: 700;
  border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center;
}
.pipeline-col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 100px; }
.pipeline-card {
  background: var(--card-bg); border-radius: 8px; padding: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07); border-left: 3px solid var(--accent);
  font-size: 13px; cursor: pointer; transition: .2s; text-decoration: none; color: var(--text);
  display: block;
}
.pipeline-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.12); color: var(--text); }
.pipeline-card-title { font-weight: 600; margin-bottom: 4px; }
.pipeline-card-meta  { font-size: 11px; color: var(--text-muted); }

/* ── PROGRESS RING ── */
.kpi-ring { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ring-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-align: center; }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh; background: linear-gradient(135deg, var(--primary) 0%, #0d2447 60%, var(--accent2) 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  background: #fff; border-radius: 16px; padding: 48px 40px;
  width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-circle {
  width: 260px; height: 72px; border-radius: 10px;
  background: #fff url('/images/logo.svg') no-repeat center / contain;
  display: inline-block; margin-bottom: 14px;
  font-size: 0; color: transparent;
}
.login-logo h2 { font-weight: 700; color: var(--primary); font-size: 1.4rem; margin: 0; }
.login-logo p  { color: var(--text-muted); font-size: 13px; }

/* hide default-credentials hint on login page */
.login-box .mt-4.p-3.rounded { display: none !important; }

/* ── CHARTS ── */
.chart-container { position: relative; min-height: 260px; }

/* ── ALERTS ── */
.alert { border-radius: var(--radius); border: none; font-size: 14px; }
.alert-success { background: rgba(40,167,69,.1); color: #155724; }
.alert-danger  { background: rgba(220,53,69,.1); color: #721c24; }

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 999; backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── IMPORT DROPZONE ── */
.import-dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  transition: .2s; background: var(--bg);
}
.import-dropzone:hover, .import-dropzone.dragover {
  border-color: var(--accent); background: rgba(46,117,182,.05);
}
.import-dropzone i { font-size: 2rem; color: var(--text-muted); margin-bottom: 8px; display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  #sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  #sidebar.open { transform: translateX(0); z-index: 1000; }
  .has-sidebar #main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .content-wrapper { padding: 14px; }
  .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table thead th, .table tbody td { white-space: nowrap; }
  .page-header h1 { font-size: 1.25rem; }
  .page-header { margin-bottom: 16px; }
  .pipeline-board { flex-direction: column; }
  .pipeline-col { min-width: unset; }
  .form-section { padding: 0 14px 12px; }
  .form-section-title { margin: 16px 0 12px; }
  .login-box { width: calc(100% - 32px); padding: 32px 24px; }
  .chart-container { min-height: 200px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar-actions { gap: 4px; flex-wrap: wrap; }
  .topbar-actions .btn { padding: 5px 10px; font-size: 12px; }
  .topbar-breadcrumb { display: none; }
  .stat-card { padding: 14px; gap: 12px; }
  .stat-value { font-size: 1.5rem; }
  .stat-icon { width: 40px; height: 40px; font-size: 17px; }
  .card-body { padding: 14px; }
  .btn-icon { width: 36px; height: 36px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header .btn { align-self: stretch; text-align: center; }
  .topbar-actions .btn span { display: none; }
}

/* ── RATING STARS ── */
.rating-input { display: flex; flex-direction: row-reverse; gap: 4px; }
.rating-input input { display: none; }
.rating-input label { font-size: 24px; color: #ccc; cursor: pointer; transition: .15s; }
.rating-input input:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label { color: #FFC107; }

/* ── MISC ── */
.text-primary { color: var(--primary) !important; }
.text-accent  { color: var(--accent) !important; }
.section-divider { height: 1px; background: var(--border); margin: 20px 0; }
.actions-cell { white-space: nowrap; }

/* ── ARABIC / RTL ── */
[dir="rtl"] body { font-family: 'Tajawal', 'Segoe UI', system-ui, sans-serif; }
[dir="rtl"] #sidebar { left: auto; right: 0; }
[dir="rtl"] #sidebar.collapsed { transform: translateX(var(--sidebar-w)); }
[dir="rtl"] .has-sidebar #main-content { margin-left: 0; margin-right: var(--sidebar-w); }
[dir="rtl"] .stat-card { border-left: none; border-right: 4px solid var(--accent); flex-direction: row-reverse; }
[dir="rtl"] .stat-card.red    { border-right-color: var(--accent2); border-left: none; }
[dir="rtl"] .stat-card.green  { border-right-color: var(--success);  border-left: none; }
[dir="rtl"] .stat-card.yellow { border-right-color: var(--warning);  border-left: none; }
[dir="rtl"] .pipeline-card { border-left: none; border-right: 3px solid var(--accent); }
[dir="rtl"] .sidebar-nav .nav-link { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .sidebar-nav .nav-link i { margin-left: 0; }
[dir="rtl"] .btn-signout { flex-direction: row-reverse; }
[dir="rtl"] .card-header { flex-direction: row-reverse; }
[dir="rtl"] .page-header { flex-direction: row-reverse; }
[dir="rtl"] .topbar-breadcrumb { text-align: right; }
[dir="rtl"] .actions-cell { text-align: left !important; }
[dir="rtl"] .form-label { display: block; text-align: right; }
[dir="rtl"] .form-section-title { text-align: right; }
[dir="rtl"] .sidebar-user { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .lang-toggle { direction: ltr; }
@media (max-width: 768px) {
  [dir="rtl"] #sidebar { transform: translateX(var(--sidebar-w)); left: auto; right: 0; }
  [dir="rtl"] #sidebar.open { transform: translateX(0); }
  [dir="rtl"] .has-sidebar #main-content { margin-right: 0; }
}
