/* =========================
   Social Mind HR – UI Kit
   ========================= */

/* ---- Brand Colors (replace with your hex) ---- */
:root{
  --brand:        #ffffff;  /* primary */
  --brand-600:    #1864ab;
  --brand-50:     #e7f2ff;
  --accent:       #ffd43b;  /* highlight */
  --surface:      #0b1020;  /* dark topbar background */
  --sidebar:      #0f152a;  /* dark sidebar */
  --text:         #101828;
  --muted:        #667085;
  --bg:           #f6f8fb;
  --white:        #fff;
  --success:      #16a34a;
  --danger:       #dc3545;
  --warning:      #f59e0b;
  --border:       #e5e7eb;
  --shadow:       0 6px 20px rgba(2,8,23,.08);
  --radius:       14px;
}

/* ---- Base ---- */
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font: 14px/1.6 system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ---- Topbar ---- */
.topbar{
  position: sticky; top:0; z-index: 50;
  display:flex; align-items:center; gap:12px;
  height:64px; padding:0 16px;
  background: linear-gradient(90deg, var(--surface), #0a0f1e 60%);
  border-bottom: 1px solid rgba(255,255,255,.06);
  color:#e6e9ef;
}
.topbar .brand{display:flex; align-items:center; gap:10px; font-weight:700; letter-spacing:.2px}
.topbar .brand img{height:28px; width:auto; display:block}
.topbar .brand span{font-size:18px; color:#f8fafc}
.topbar .btn.only{color:#cbd5e1; background:transparent; border:1px solid rgba(255,255,255,.1)}
.topbar .topbar-right{margin-left:auto; display:flex; align-items:center; gap:12px}
.avatar{
  width:34px; height:34px; border-radius:50%;
  display:grid; place-items:center;
  background:linear-gradient(135deg,var(--brand),var(--brand-600));
  color:white; font-weight:700;
}

/* ===== Shell grid: sidebar + content ===== */
.shell{
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: auto;
  min-height: calc(100vh - 64px);
}

/* ---- Sidebar ---- */
.sidebar{
  position: sticky;        /* sits under the topbar */
  top: 64px;
  height: calc(100vh - 64px);
  background: var(--sidebar);
  border-right: 1px solid rgba(255,255,255,.06);
  padding: 16px;
  overflow-y: auto;
  z-index: 40;             /* below the topbar (set that > 40) */
}

.sidebar.closed{ transform: translateX(-100%); }
.sidebar nav{display:flex; flex-direction:column; gap:6px}
.nav-section{margin:12px 8px 6px; color:#93a4bf; font-size:14px;}
.nav-link{
  display:block; padding:10px 12px; border-radius:10px;
  color:#dbe2ef; text-decoration:none; font-weight:600;
}
.nav-link:hover{ background: rgba(255,255,255,.06); }
.nav-link.active{ background: linear-gradient(135deg, rgba(28,126,214,.25), rgba(28,126,214,.08)); color:#fff; }

.logout{ margin-top: 16px; }

/* ---- Content ---- */
.content{
  padding: 24px;
  background: var(--bg);
}
.footer{
  padding: 16px 24px;
  color: var(--muted);
  grid-column: 1 / -1;     /* span both columns if desired */
}

/* ---- Cards ---- */
.card{
  background:var(--white); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow: var(--shadow); padding:18px;
}
.card h3{ margin:0 0 8px; }

/* ---- Buttons ---- */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 14px; border-radius:10px; border:1px solid var(--border);
  background:var(--brand); font-weight:700; cursor:pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.03);
}
.btn:hover{ background:var(--brand-600); color: white; }
.btn.secondary{ background:#e9ecef; color:#0f172a; }
.btn.ghost{ background:transparent; border:1px solid var(--border); color:#0f172a;}
.btn.danger{ background:var(--danger); }
.btn.block{ width:100%; text-align:center; }
.btn.icon{ padding:8px 10px; }

/* ---- Forms ---- */
form label{ display:block; font-weight:600; color:#111827; margin:10px 0 4px; }
input[type="text"],input[type="email"],input[type="password"],input[type="date"],input[type="number"],select,textarea{
  width:100%; padding:10px 12px; border-radius:10px; border:1px solid var(--border); background:#fff;
}
input:focus, select:focus, textarea:focus{ outline:none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(28,126,214,.15); }

/* ---- Tables ---- */
table{ width:100%; border-collapse:separate; border-spacing:0; background:white; border:1px solid var(--border); border-radius:12px; overflow:hidden; box-shadow: var(--shadow); }
th, td{ padding:12px 14px; border-bottom:1px solid var(--border); }
th{ text-align:left; background:#f8fafc; color:#0f172a; font-weight:700; }
tr:last-child td{ border-bottom:none; }
tr:hover td{ background:#fafbff; }

/* ---- Badges ---- */
.badge{ display:inline-block; padding:4px 8px; border-radius:999px; font-size:12px; font-weight:700; }
.badge.pending{ background:#fff7ed; color:#9a3412; border:1px solid #fed7aa; }
.badge.approved{ background:#ecfdf5; color:#166534; border:1px solid #bbf7d0; }
.badge.rejected{ background:#fef2f2; color:#991b1b; border:1px solid #fecaca; }

/* ---- Alerts ---- */
.alert{ padding:12px 14px; border-radius:12px; margin:12px 0; border:1px solid var(--border); box-shadow: var(--shadow); }
.alert.success{ background:#ecfdf5; color:#065f46; border-color:#bbf7d0; }
.alert.error{ background:#fef2f2; color:#7f1d1d; border-color:#fecaca; }
.alert.info{ background:#eff6ff; color:#1e3a8a; border-color:#bfdbfe; }

/* ---- Tabs (simple) ---- */
.tabs{ display:flex; gap:8px; border-bottom:1px solid var(--border); margin-bottom:12px; }
.tabs a{ text-decoration:none; color:#0f172a; padding:10px 12px; border-radius:10px 10px 0 0; }
.tabs a:hover{ background:#f3f4f6; }
.tab-content{ padding:4px 0; }

/* Scrim: fixed overlay, does not affect layout */
.scrim{
  position: fixed;
  left: 0; right: 0; top: 64px; bottom: 0;
  background: rgba(15,21,42,.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 35;
}
.scrim.show{
  opacity: 1;
  pointer-events: auto;
}

/* ===== Onboarding ===== */
.prose p { margin: 0 0 0.75rem 0; line-height: 1.6; }
.prose h1, .prose h2, .prose h3 { margin: 1rem 0 0.5rem 0; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0.5rem 0; }


/* ===== Form controls (global polish) ===== */
label {
  display: block;
  font-weight: 600;
  margin: 6px 0 4px;
  color: #0b1220;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="month"],
input[type="number"],
select,
textarea {
  width: 100%;
  appearance: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 10px;
  line-height: 1.4;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

/* Month control specific tweaks */
.control--month {
  padding-left: 38px; /* room for icon */
}

.input-icon {
  position: relative;
}

.input-icon svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: .6;
  pointer-events: none;
}

/* Icon wrapper */
.input-icon { position: relative; }
.input-icon .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  opacity: .65;
  color: #334155;
  pointer-events: none;
}

/* Ensure room for the icon */
input[type="month"].control--month { padding-left: 40px; }

/* WebKit fix: move the typed value right so it doesn't sit under the icon */
input[type="month"].control--month::-webkit-datetime-edit { padding-left: 24px; }

/* (Optional) same idea if you style date inputs elsewhere */
input[type="date"].control--date { padding-left: 40px; }
input[type="date"].control--date::-webkit-datetime-edit { padding-left: 24px; }

/* Keep the native picker button on the right tinted and clickable */
input[type="month"]::-webkit-calendar-picker-indicator {
  filter: invert(24%) sepia(66%) saturate(2351%) hue-rotate(214deg) brightness(90%) contrast(88%);
  opacity: .8;
  cursor: pointer;
}

.badge.muted { background:#e5e7eb; color:#374151; }

/* Tint the native picker icon (WebKit) to fit the palette */
input[type="month"]::-webkit-calendar-picker-indicator {
  filter: invert(24%) sepia(66%) saturate(2351%) hue-rotate(214deg) brightness(90%) contrast(88%);
  opacity: .8;
  cursor: pointer;
}


/* Approve/Deny actions layout */
.table-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 360px;       /* gives room for input + button */
}

.action-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-inline input[type="text"] {
  flex: 1;
  min-width: 220px;
}

.action-inline .btn {
  white-space: nowrap;
  padding-inline: 12px;
}

/* Small screens: stack input above button */
@media (max-width: 900px) {
  .table-actions { min-width: 0; }
  .action-inline { flex-direction: column; align-items: stretch; }
  .action-inline .btn { width: 100%; }
}

/* Simple 2-col grid utility used in pages */
.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 700px) { .grid-two { grid-template-columns: 1fr; } }


/* Utility grids */
.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sys-banner{
  background:#fef3c7;           /* amber-100 */
  color:#92400e;                 /* amber-800 */
  border-bottom:1px solid #f59e0b;
  padding:10px 16px;
  display:flex;
  align-items:center;
  gap:10px;
  justify-content:center;
}
.sys-banner .btn.ghost{
  background:#fff7ed;           /* amber-50 */
  color:#92400e;
  border:1px solid #fbbf24;
}
.sys-banner .btn.ghost:hover{
  background:#fffbeb;
}


@media (max-width: 640px) {
  .grid-two { grid-template-columns: 1fr; }
}

/* Cards layout group with spacing */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .grid-cards { grid-template-columns: 1fr; }
}

/* General card spacing (if not already) */
.card {
  margin-bottom: 16px; /* extra bottom space so stacked cards breathe */
}

/* Metric look */
.metric {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 12px;
}
.metric-label { font-size: .85rem; color: #64748b; }
.metric-value { font-weight: 700; font-size: 1.25rem; }


#myCalendar { margin-top: 8px; }
/* Right-aligned numeric table cells */
table .num { text-align: right; }

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 640px) { .grid-two { grid-template-columns: 1fr; } }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .grid-cards { grid-template-columns: 1fr; } }

.help { font-size: .9rem; }

table .num { text-align: right; }



/* ---- Responsive ---- */
@media (max-width: 640px) {
  .btn { padding: 10px 14px; }
  .card { padding: 14px; }
}

/* Desktop ≥ 961px: docked and push content */
@media (min-width: 961px){
  .sidebar { transform: none; }     /* ensure visible */
  .content, .footer { margin-left: 260px; }  /* push content right */
}


/* Mobile ≤ 960px: off-canvas by default */
@media (max-width: 960px){
  .shell{
    grid-template-columns: 1fr;  /* no sidebar column */
  }

  .sidebar{
    position: fixed;
    left: 0; right: auto; top: 64px; bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.open{ transform: translateX(0); }

  .content, .footer{
    grid-column: 1 / -1;
    margin-left: 0; /* ensure no leftover margins */
  }

  /* scrim behind sidebar */
  .scrim{
    position: fixed; left:0; right:0; top:64px; bottom:0;
    background: rgba(15,21,42,.5);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
    z-index: 35;
  }
  .scrim.show{ opacity: 1; pointer-events: auto; }
}
