/* HRMS – shared styles */
:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1f2937;
    --sidebar-hover: #374151;
    --sidebar-text: #d1d5db;
    --sidebar-active: #2563eb;
    --topbar-bg: #ffffff;
    --body-bg: #f3f4f6;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

html, body { height: 100%; }
body { background: var(--body-bg); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 14px; }

/* Layout */
.app-wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 1000;
}
.sidebar .brand {
    padding: 20px 20px 16px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand small { display: block; font-size: 11px; font-weight: 400; color: #9ca3af; margin-top: 2px; }
.sidebar .nav-section { padding: 12px 20px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; }
.sidebar a.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.sidebar a.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar a.nav-link.active { background: var(--sidebar-hover); color: #fff; border-left-color: var(--sidebar-active); }
.sidebar a.nav-link i { width: 18px; text-align: center; }

.main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.topbar {
    background: var(--topbar-bg);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: var(--card-shadow);
    position: sticky; top: 0; z-index: 500;
}
.topbar .page-title { font-size: 16px; font-weight: 600; margin: 0; }
.topbar .user-box { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.topbar .user-box .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--sidebar-active); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px;
}

.content { padding: 24px; flex: 1; }

/* Cards & stats */
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 18px 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff;
}
.stat-card .stat-label { color: #6b7280; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; margin: 0; }
.stat-card .stat-value { font-size: 24px; font-weight: 600; margin: 2px 0 0; color: #111827; }
.bg-primary-soft { background: #3b82f6; }
.bg-success-soft { background: #10b981; }
.bg-danger-soft  { background: #ef4444; }
.bg-warning-soft { background: #f59e0b; }
.bg-info-soft    { background: #06b6d4; }
.bg-secondary-soft { background: #6b7280; }

.card-hrms {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    border: 0;
}
.card-hrms .card-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 14px;
}
.card-hrms .card-body { padding: 18px; }

/* Status badges */
.badge-status { font-size: 11px; font-weight: 500; padding: 4px 8px; border-radius: 4px; }
.status-present    { background: #d1fae5; color: #065f46; }
.status-absent     { background: #fee2e2; color: #991b1b; }
.status-half_day   { background: #fef3c7; color: #92400e; }
.status-leave      { background: #e0e7ff; color: #3730a3; }
.status-holiday    { background: #f3e8ff; color: #6b21a8; }
.status-week_off   { background: #e5e7eb; color: #374151; }
.status-missing_punch { background: #fed7aa; color: #9a3412; }

/* Device dot */
.device-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.device-dot.online  { background: #10b981; }
.device-dot.offline { background: #ef4444; }
.device-dot.unknown { background: #9ca3af; }

/* Login page */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,.2);
    width: 100%; max-width: 400px;
    padding: 32px;
}
.login-card h1 { font-size: 20px; font-weight: 600; margin-bottom: 4px; text-align: center; }
.login-card .subtitle { color: #6b7280; font-size: 13px; text-align: center; margin-bottom: 24px; }

/* Table tweaks */
table.dataTable thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: #374151; }
table.dataTable tbody td { vertical-align: middle; font-size: 13px; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
}

.spinner-wrap { display: flex; justify-content: center; align-items: center; padding: 30px; }
