/* ============================================================
   Cubify Attendance System — Custom Stylesheet
   ============================================================ */

/* ── Google Font ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS variables ────────────────────────────────────────── */
:root {
    --sidebar-width:       250px;
    --navbar-height:       56px;
    --primary:             #3b82f6;
    --primary-dark:        #1d4ed8;
    --sidebar-bg:          #0f172a;
    --sidebar-hover:       #1e293b;
    --sidebar-active:      #1e40af;
    --sidebar-text:        #94a3b8;
    --sidebar-text-active: #ffffff;
    --body-bg:             #f1f5f9;
    --card-radius:         12px;
    --transition:          0.2s ease;
}

/* ── Reset / Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--body-bg);
    color: #1e293b;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* ── Navbar ───────────────────────────────────────────────── */
.cubify-navbar {
    height: var(--navbar-height);
    background: var(--sidebar-bg) !important;
    border-bottom: 1px solid #1e293b;
    z-index: 1050;
}

.brand-cube {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 15px;
}

.brand-name {
    font-size: 17px;
    color: white;
    letter-spacing: -0.3px;
}

.user-avatar-btn {
    background: transparent;
    border: none;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background var(--transition);
}
.user-avatar-btn:hover { background: rgba(255,255,255,0.1); }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: var(--sidebar-bg);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform var(--transition);
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    padding: 20px 16px 16px;
    border-bottom: 1px solid #1e293b;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #475569;
    padding: 10px 12px 4px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    margin-bottom: 2px;
    font-size: 13.5px;
    font-weight: 500;
}

.sidebar-nav .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.sidebar-nav .nav-link.text-danger-soft {
    color: #f87171;
}
.sidebar-nav .nav-link.text-danger-soft:hover {
    background: rgba(239,68,68,0.1);
    color: #fca5a5;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #1e293b;
}

/* ── Page wrapper ─────────────────────────────────────────── */
.page-wrapper {
    display: flex;
    padding-top: var(--navbar-height);
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    transition: margin var(--transition);
}

.content-area {
    padding: 24px;
    min-height: calc(100vh - var(--navbar-height));
}

/* ── Page header ──────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.06);
    background: white;
}

.card-header {
    background: white;
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 18px;
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
}

.card-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
}

.card-body { padding: 18px; }

.card-footer {
    background: #fafafa;
    border-top: 1px solid #f1f5f9;
    padding: 12px 18px;
    border-radius: 0 0 var(--card-radius) var(--card-radius);
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
    background: white;
    border-radius: var(--card-radius);
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    color: inherit;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.stat-sublabel {
    font-size: 11px;
    color: #94a3b8;
}

/* ── Attendance action card ──────────────────────────────── */
.attendance-card {
    background: linear-gradient(135deg, #eff6ff 0%, #fff 60%);
    border: 1px solid #dbeafe;
}

.attendance-status-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.status-out  { background: #fee2e2; color: #dc2626; }
.status-in   { background: #dcfce7; color: #16a34a; }
.status-done { background: #eff6ff; color: #2563eb; }

/* ── Avatars ──────────────────────────────────────────────── */
.user-avatar-lg, .user-avatar-sm, .user-avatar-xs {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.user-avatar-lg  { width: 42px; height: 42px; font-size: 16px; }
.user-avatar-sm  { width: 34px; height: 34px; font-size: 12px; }
.user-avatar-xs  { width: 28px; height: 28px; font-size: 10px; }

/* ── Tables ───────────────────────────────────────────────── */
.table thead th {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
    padding: 10px 14px;
    background: #fafafa;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
}

.table-hover tbody tr:hover { background: #f8fafc; }

/* ── Hours bar ────────────────────────────────────────────── */
.hours-bar-wrap {
    width: 60px;
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.hours-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn { font-weight: 500; border-radius: 8px; }
.btn-xs { padding: 3px 8px; font-size: 11.5px; border-radius: 6px; }

.btn-checkin {
    background: #16a34a;
    border-color: #16a34a;
    color: white;
    padding: 8px 18px;
}
.btn-checkin:hover { background: #15803d; border-color: #15803d; color: white; }

.btn-checkout {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
    padding: 8px 18px;
}
.btn-checkout:hover { background: #b91c1c; border-color: #b91c1c; color: white; }

.btn-login { border-radius: 10px; padding: 11px; font-size: 15px; }

/* ── Soft background utilities ────────────────────────────── */
.bg-primary-soft  { background: #eff6ff; }
.bg-success-soft  { background: #f0fdf4; }
.bg-danger-soft   { background: #fef2f2; }
.bg-warning-soft  { background: #fffbeb; }
.bg-info-soft     { background: #f0f9ff; }

/* ── Charts ───────────────────────────────────────────────── */
.chart-container { position: relative; width: 100%; }

/* ── Typography helpers ───────────────────────────────────── */
.x-small { font-size: 11px; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ── Live clock ───────────────────────────────────────────── */
.live-clock { font-size: 13px; }

/* ── Login page ───────────────────────────────────────────── */
.login-body {
    background: #f1f5f9;
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.login-bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    z-index: 0;
}

.login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.login-panel-left {
    width: 45%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
}

.login-left-content { max-width: 420px; }
.text-white-75 { color: rgba(255,255,255,0.75); }

.login-features { display: flex; flex-direction: column; gap: 16px; }

.login-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255,255,255,0.8);
    font-size: 15px;
}

.login-feature-item i {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    font-size: 15px;
}

.login-panel-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.login-form-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

/* ── Input group icon ─────────────────────────────────────── */
.input-group-text {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

.form-control, .form-select {
    border-color: #e2e8f0;
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* ── Sidebar overlay (mobile) ─────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1030;
}

.sidebar-overlay.show { display: block; }

/* ── Mobile / responsive ──────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    .content-area { padding: 16px; }
    .page-title   { font-size: 18px; }
    .stat-value   { font-size: 22px; }
    .login-form-card { padding: 28px 20px; }
}
