/* =============================================
   Employee Time Portal – Main Stylesheet
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #1a73e8;
  --primary-d: #1558b0;
  --accent:    #34a853;
  --danger:    #ea4335;
  --warn:      #fbbc04;
  --bg:        #f0f2f5;
  --card:      #ffffff;
  --text:      #202124;
  --muted:     #5f6368;
  --border:    #dadce0;
  --radius:    8px;
  --shadow:    0 2px 8px rgba(0,0,0,.12);
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 0 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .5px;
}
.emp-nav a {
  color: rgba(255,255,255,.9);
  text-decoration: none;
  margin-left: 20px;
  font-size: .9rem;
  transition: color .2s;
}
.emp-nav a:hover { color: #fff; text-decoration: underline; }

/* ---- Main ---- */
.main-content {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 32px auto;
  padding: 0 16px;
}

/* ---- Cards ---- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 24px;
}
.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
}

/* ---- Dashboard Grid ---- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  text-align: center;
}
.stat-card .stat-val {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-card .stat-label {
  font-size: .85rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ---- Punch Clock ---- */
.clock-widget {
  text-align: center;
  padding: 40px 32px;
}
.clock-widget .clock-time {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text);
  margin-bottom: 8px;
}
.clock-widget .clock-date {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 32px;
}
.clock-status {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 28px;
}
.status-out  { background: #fce8e6; color: var(--danger); }
.status-in   { background: #e6f4ea; color: var(--accent); }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
  color: var(--text);
  background: #fff;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-d); }
.btn-success  { background: var(--accent); color: #fff; }
.btn-success:hover  { background: #2d9147; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover   { background: #c62828; }
.btn-warning  { background: var(--warn); color: var(--text); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #c5c8cc; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 14px 36px; font-size: 1.1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---- Alerts / Messages ---- */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: .9rem;
  font-weight: 500;
}
.alert-success { background: #e6f4ea; color: #1e7e34; border-left: 4px solid var(--accent); }
.alert-danger   { background: #fce8e6; color: #c0392b; border-left: 4px solid var(--danger); }
.alert-info     { background: #e8f0fe; color: #174ea6; border-left: 4px solid var(--primary); }
.alert-warning  { background: #fef9e7; color: #856404; border-left: 4px solid var(--warn); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
thead th {
  background: var(--bg);
  padding: 11px 14px;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  text-transform: uppercase;
  font-size: .78rem;
  letter-spacing: .5px;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8f9fa; }

/* ---- Login page ---- */
.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
}
.login-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 44px;
  width: 100%;
  max-width: 420px;
}
.login-card h2 {
  text-align: center;
  margin-bottom: 28px;
  color: var(--primary);
  font-size: 1.4rem;
}

/* ---- PIN pad ---- */
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px auto;
  max-width: 260px;
}
.pin-pad .pin-btn {
  padding: 18px;
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
}
.pin-pad .pin-btn:hover { background: var(--border); }
.pin-display {
  text-align: center;
  font-size: 2rem;
  letter-spacing: 8px;
  margin: 10px 0;
  min-height: 44px;
  color: var(--primary);
}

/* ---- Tabs ---- */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 22px; }
.tab-btn {
  padding: 10px 22px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: .9rem;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---- Footer ---- */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 14px;
  font-size: .82rem;
  color: var(--muted);
}

/* ---- Utility ---- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 12px; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 700;
}
.badge-success { background: #e6f4ea; color: var(--accent); }
.badge-danger  { background: #fce8e6; color: var(--danger); }
.badge-info    { background: #e8f0fe; color: var(--primary); }
.badge-warn    { background: #fef9e7; color: #856404; }

.site-map {
  width: 100%;
  height: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #eef3fb;
}

.site-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.site-image-preview-wrap {
  min-height: 24px;
}

.site-image-preview {
  display: none;
  width: 100%;
  max-width: 360px;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.site-image-preview.visible {
  display: block;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
  .main-content { margin: 16px auto; }
  .card { padding: 18px 16px; }
  .site-map { height: 220px; }
}
