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

* { margin:0; padding:0; box-sizing:border-box }

:root {
    --primary:#0b2b4a;
    --primary-light:#134b6e;
    --accent:#d4a843;
    --bg:#f4f6f9;
    --surface:#ffffff;
    --text:#1a1a2e;
    --text-secondary:#5c6b7a;
    --border:#e1e5ea;
    --shadow-sm:0 1px 3px rgba(0,0,0,0.04);
    --shadow-md:0 4px 15px rgba(0,0,0,0.06);
    --shadow-lg:0 12px 40px rgba(0,0,0,0.08);
    --radius:12px;
    --radius-lg:16px;
    --radius-xl:20px;
    --transition:0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* ═══════════ MOBILE TOP BAR ═══════════ */
.mobile-topbar {
    display: none;
    position: fixed;
    top:0; left:0; right:0;
    z-index: 1200;
    background: var(--primary);
    color: #fff;
    height: 50px;
    padding: 0 14px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.hamburger {
    background: none; border: none;
    color: #fff; font-size: 24px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    margin-left: -4px;
}
.topbar-title {
    font-weight: 700; font-size: 16px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.topbar-spacer { width: 40px; }

/* ═══════════ SIDEBAR ═══════════ */
.sidebar {
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #0b2b4a 0%, #0f3460 100%);
    color: #fff;
    position: fixed;
    top:0; left:0;
    overflow-y: auto;
    z-index: 1300;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}
.sidebar-header {
    padding: 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-header .brand-icon {
    background: rgba(255,255,255,0.12);
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.sidebar-header .brand-name {
    font-size: 16px; font-weight: 700;
    background: linear-gradient(135deg, #fff, #e0c68c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sidebar-header .brand-sub {
    font-size: 9px; color: rgba(255,255,255,0.6);
    text-transform: uppercase; letter-spacing: 1px;
}
.sidebar-nav { flex:1; padding: 8px 0; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 22px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 13px; font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    margin: 1px 0;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; border-left-color: var(--accent); }
.sidebar-nav a.active { background: rgba(255,255,255,0.12); color: #fff; border-left-color: var(--accent); font-weight: 600; }
.sidebar-nav a.logout-link { margin-top: auto; color: rgba(255,255,255,0.5); }
.sidebar-nav a.logout-link:hover { color: #ffb3b3; background: rgba(231,76,60,0.2); }

/* Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.5);
    z-index: 1250;
}
.sidebar-overlay.show { display: block; }

/* ═══════════ MAIN CONTENT ═══════════ */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 32px 36px;
    max-width: 1300px;
    width: 100%;
    animation: fadeUp 0.3s ease;
}
@keyframes fadeUp { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }

/* ═══════════ TYPOGRAPHY ═══════════ */
.page-title { font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.page-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 22px; }

/* ═══════════ CARDS ═══════════ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; margin: 22px 0; }
.stat-card {
    background: var(--surface); padding: 20px 18px; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); transition: all var(--transition);
    position: relative; overflow: hidden; border: 1px solid rgba(0,0,0,0.02);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card .stat-icon { font-size: 26px; margin-bottom: 8px; }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.stat-value { font-size: 30px; font-weight: 700; color: var(--primary); letter-spacing: -1px; line-height: 1; }

/* ═══════════ TABLES ═══════════ */
.table-container { background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
table { width:100%; border-collapse: collapse; }
th { background: #f8fafb; font-weight: 600; color: #4a5568; font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; padding: 12px 14px; text-align: left; border-bottom: 2px solid var(--border); }
td { padding: 12px 14px; font-size: 13px; border-bottom: 1px solid #f1f3f5; color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfd; }
.td-name { font-weight: 600; color: var(--primary); }

/* ═══════════ BUTTONS ═══════════ */
.btn {
    background: var(--primary); color: #fff; border: none;
    padding: 11px 22px; cursor: pointer; font-size: 13px; font-weight: 600;
    border-radius: var(--radius); text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all var(--transition);
}
.btn:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(11,43,74,0.2); }
.btn-danger { background: #fff; color: #e74c3c; border: 1px solid #fce4e4; }
.btn-danger:hover { background: #e74c3c; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 11px; }

/* ═══════════ BADGES ═══════════ */
.badge { display: inline-block; padding: 4px 12px; font-size: 10px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; border-radius: 20px; }
.badge-success { background: #e0f5e9; color: #1e7e34; }
.badge-warning { background: #fff3d6; color: #b45309; }
.badge-danger { background: #fde8e8; color: #c0392b; }
.badge-info { background: #e0ecf9; color: #1e40af; }
.badge-purple { background: #f3e8ff; color: #7c3aed; }   /* added for profile */

/* ═══════════ ALERTS ═══════════ */
.alert { padding: 12px 16px; margin: 12px 0; border-radius: var(--radius); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.alert-error { background: #fef0ef; color: #c0392b; border-left: 4px solid #e74c3c; }
.alert-success { background: #eafaf1; color: #1e7e34; border-left: 4px solid #27ae60; }
.alert-warning { background: #fff3d6; color: #b45309; border-left: 4px solid #f59e0b; }
.alert-info { background: #e8f0fe; color: #1e40af; border-left: 4px solid #2563eb; }

/* ═══════════ CHECK‑IN PAGE ═══════════ */
.shift-timer-card {
    background: var(--surface); border-radius: var(--radius-lg);
    padding: 18px; box-shadow: var(--shadow-sm); text-align: center; margin-bottom: 18px;
}
.timer-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }
.timer-value { font-size: 28px; font-weight: 700; color: var(--primary); margin: 4px 0 2px; }
.timer-remaining { font-size: 14px; font-weight: 600; color: var(--accent); }

.checkin-container {
    background: var(--surface); padding: 34px 20px; border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md); text-align: center; margin: 18px 0;
}
.checkin-greeting-icon { font-size: 40px; margin-bottom: 8px; }
.checkin-title { font-size: 21px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.checkin-subtitle { color: var(--text-secondary); font-size: 13px; margin-bottom: 22px; }

.checkin-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 15px 34px; font-size: 15px; font-weight: 700;
    border-radius: 50px; text-decoration: none; letter-spacing: 0.5px;
    border: none; cursor: pointer; overflow: hidden;
    transition: all 0.4s ease; background-size: 200% auto; color: #fff;
    box-shadow: 0 8px 22px rgba(0,0,0,0.15);
}
.btn-check-in { background-image: linear-gradient(135deg, #27ae60 0%, #2ecc71 50%, #27ae60 100%); }
.btn-check-in:hover { background-position: right center; transform: scale(1.03); box-shadow: 0 10px 28px rgba(39,174,96,0.4); }
.btn-check-out { background-image: linear-gradient(135deg, #e74c3c 0%, #c0392b 50%, #e74c3c 100%); margin-top: 14px; }
.btn-check-out:hover { background-position: right center; transform: scale(1.03); box-shadow: 0 10px 28px rgba(231,76,60,0.4); }

.btn-lunch { background: #f39c12; color: #fff; border: none; padding: 10px 22px; border-radius: 20px; font-weight: 600; cursor: pointer; margin: 8px 0; }
.btn-lunch:hover { background: #e67e22; }
.btn-lunch-end { background: #27ae60; color: #fff; border: none; padding: 10px 22px; border-radius: 20px; font-weight: 600; cursor: pointer; margin: 8px 0; }
.btn-lunch-end:hover { background: #2ecc71; }

.status-badge { display: inline-block; padding: 5px 16px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; margin-bottom: 10px; }
.status-badge.working { background: #e0f5e9; color: #1e7e34; }

.location-status { padding: 10px 14px; margin-bottom: 16px; background: #fff; border: 1px solid var(--border); font-size: 12px; border-radius: 10px; display: flex; align-items: center; gap: 8px; }

/* ═══════════ FILTER BAR ═══════════ */
.filter-bar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-btn {
    background: var(--surface); border: 1px solid var(--border);
    padding: 8px 16px; border-radius: 30px; font-size: 12px; font-weight: 500;
    color: var(--text-secondary); cursor: pointer; text-decoration: none;
    transition: all 0.2s;
}
.filter-btn.active, .filter-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ═══════════ FORMS ═══════════ */
.form-card { background: var(--surface); padding: 20px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; align-items: end; }
input, select, textarea { border: 1.5px solid var(--border); padding: 10px 14px; font-size: 13px; width: 100%; border-radius: var(--radius); background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,43,74,0.08); }
label { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 700; color: #4a5568; text-transform: uppercase; letter-spacing: 0.5px; }

/* ═══════════ MODALS ═══════════ */
.modal-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.5); z-index:2000; display: flex; align-items: center; justify-content: center; }
.modal-box { background: var(--surface); border-radius: var(--radius-xl); padding: 26px; max-width: 420px; width: 90%; box-shadow: var(--shadow-lg); text-align: center; }
.modal-box h3 { margin-bottom: 10px; }
.modal-box p { color: var(--text-secondary); margin-bottom: 18px; font-size: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* ═══════════ Sales Manager / Profile ═══════════ */
.sm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.sm-column { display: flex; flex-direction: column; gap: 16px; }
.sm-card {
    background: rgba(255,255,255,0.9); backdrop-filter: blur(12px);
    border-radius: var(--radius-xl); padding: 18px;
    box-shadow: var(--shadow-md); border: 1px solid rgba(255,255,255,0.3);
}
.sm-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 2px solid #e8ecf0; }
.sm-card-header h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.profile-card {
    background: var(--surface); border-radius: var(--radius-xl);
    padding: 22px; box-shadow: var(--shadow-md); margin-bottom: 22px;
}
.profile-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700;
}
.profile-info h2 { margin: 0 0 4px 0; font-size: 19px; font-weight: 700; }
.profile-details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 2px solid #e8ecf0; padding-top: 14px; }
.detail-item { display: flex; flex-direction: column; }
.detail-label { font-size: 10px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; }
.detail-value { font-size: 13px; font-weight: 600; }

.target-progress-card { background: var(--surface); padding: 16px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.progress-bar-bg { height: 18px; background: #e8ecf0; border-radius: 9px; overflow: hidden; margin: 8px 0; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, #27ae60, #2ecc71); border-radius: 9px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; }
.progress-text { color: #fff; font-size: 11px; font-weight: 700; }

/* ═══════════ MOBILE RESPONSIVE ═══════════ */
@media (max-width: 768px) {
    .mobile-topbar { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        width: 78%;
        max-width: 280px;
    }
    .sidebar.open { transform: translateX(0); }

    .main-content {
        margin-left: 0 !important;
        padding: 16px 12px;
        padding-top: 60px;
    }

    .page-title { font-size: 20px; }
    .page-subtitle { font-size: 12px; margin-bottom: 16px; }

    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px 12px; }
    .stat-card .stat-icon { font-size: 22px; }
    .stat-value { font-size: 22px; }

    .checkin-container { padding: 22px 14px; margin: 12px 0; }
    .checkin-btn { width: 100%; justify-content: center; padding: 14px 20px; font-size: 14px; }

    .form-grid { grid-template-columns: 1fr; gap: 10px; }
    .sm-grid { grid-template-columns: 1fr; gap: 12px; }
    .sm-card { padding: 14px; }

    .profile-header { flex-direction: column; text-align: center; gap: 8px; }
    .profile-details { grid-template-columns: 1fr; gap: 10px; }

    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 480px; }
    th, td { padding: 10px 12px; font-size: 12px; }

    .btn { width: 100%; justify-content: center; }
    .btn-danger, .btn-sm { width: auto; }

    img, svg { max-width: 100%; height: auto; }
}

@media (max-width: 400px) {
    .stats { grid-template-columns: 1fr; }
    .stat-value { font-size: 20px; }
    .checkin-btn { padding: 12px 16px; font-size: 13px; }
}
