:root {
    --orange: #E85A0A;
    --pink: #EC1E82;
    --blue: #3750B4;
    --cyan: #2DB9D7;
    --dark: #2B2B33;
    --gradient: linear-gradient(90deg, var(--orange), var(--pink), var(--blue));
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; color: #333; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: #777; font-size: 14px; margin-bottom: 15px; }
.muted a { color: var(--pink); font-weight: 500; }

/* Brand */
.brand { font-size: 28px; font-weight: 700; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-light { background: linear-gradient(90deg, #FFB37A, #FF7FC0, #8FA3FF); -webkit-background-clip: text; background-clip: text; }

/* Header */
.header { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav a { margin: 0 15px; font-weight: 500; }
.nav a:hover { color: var(--pink); }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* Buttons */
.btn { display: inline-block; padding: 11px 26px; border-radius: 30px; font-weight: 600; font-family: inherit; font-size: 15px; border: none; cursor: pointer; transition: transform .2s, box-shadow .2s, opacity .2s; text-align: center; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,.12); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--gradient); color: #fff; }
.btn-light { background: #fff; color: var(--blue); }
.btn-ghost { border: 2px solid #fff; color: #fff; background: transparent; }
.btn-outline { border: 2px solid var(--pink); color: var(--pink); background: #fff; padding: 8px 20px; }
.btn-link { background: none; color: #555; padding: 8px 12px; }
.btn-link:hover { box-shadow: none; color: var(--pink); }
.btn-block { display: block; width: 100%; }

/* Hero */
.hero { background: var(--gradient); color: #fff; text-align: center; padding: 100px 0; }
.hero-tag { display: inline-block; background: rgba(255,255,255,.2); padding: 6px 16px; border-radius: 20px; font-size: 14px; margin-bottom: 20px; }
.hero h1 { font-size: 48px; line-height: 1.2; margin-bottom: 20px; }
.hero h1 span { color: #FFE08A; }
.hero p { max-width: 680px; margin: 0 auto 35px; font-size: 18px; opacity: .95; }
.hero-buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }

/* Sections */
.section { padding: 80px 0; }
.section-grey { background: #f7f7fa; }
.section-title { text-align: center; font-size: 34px; margin-bottom: 50px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 25px; align-items: start; }

.card { background: #fff; padding: 30px; border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.06); transition: transform .3s; }
.card:hover { transform: translateY(-5px); }
.card .icon { font-size: 36px; margin-bottom: 10px; }
.card h3 { color: var(--blue); margin-bottom: 8px; }
.card p { color: #666; font-size: 15px; }

/* Pricing */
.price-card { background: #fff; padding: 35px 28px; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,.06); position: relative; }
.price-card.popular { border: 2px solid var(--pink); transform: scale(1.04); }
.badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--gradient); color: #fff; font-size: 12px; padding: 4px 14px; border-radius: 20px; }
.price-card h3 { color: var(--blue); }
.price { font-size: 36px; font-weight: 700; margin: 10px 0 20px; }
.price small { font-size: 14px; color: #888; font-weight: 400; }
.price-card ul { list-style: none; margin-bottom: 25px; }
.price-card li { padding: 6px 0; color: #555; border-bottom: 1px dashed #eee; }

/* Footer */
.footer { background: var(--dark); color: #bbb; text-align: center; padding: 50px 0 25px; }
.footer p { margin-top: 10px; }
.copyright { font-size: 13px; color: #888; margin-top: 25px !important; }

/* Login Modal */
.modal { position: fixed; inset: 0; background: rgba(20,20,30,.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; opacity: 0; visibility: hidden; transition: .25s; }
.modal.show { opacity: 1; visibility: visible; }
.modal-box { background: #fff; width: 100%; max-width: 400px; border-radius: 18px; padding: 35px 30px; position: relative; transform: translateY(20px); transition: .25s; }
.modal.show .modal-box { transform: translateY(0); }
.modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 28px; color: #999; cursor: pointer; }
.modal-brand { text-align: center; margin-bottom: 15px; }
.modal-box h3 { font-size: 22px; margin-bottom: 4px; }
.phone-input { display: flex; border: 2px solid #e3e3ea; border-radius: 10px; overflow: hidden; margin-bottom: 18px; }
.phone-input:focus-within, .otp-input:focus { border-color: var(--pink); }
.phone-input span { background: #f4f4f8; padding: 12px 14px; font-weight: 600; color: #555; }
.phone-input input { flex: 1; border: none; outline: none; padding: 12px; font-size: 16px; font-family: inherit; }
.otp-input { width: 100%; border: 2px solid #e3e3ea; border-radius: 10px; padding: 12px; font-size: 24px; letter-spacing: 12px; text-align: center; outline: none; margin-bottom: 18px; font-family: inherit; }
#resendLink.disabled { color: #bbb; pointer-events: none; }
.msg { margin-top: 15px; font-size: 14px; text-align: center; min-height: 20px; }
.msg.ok { color: #1a9e55; }
.msg.err { color: #d93025; }

/* Mobile */
@media (max-width: 768px) {
    .nav { display: none; }
    .hero h1 { font-size: 32px; }
    .price-card.popular { transform: none; }
}

/* Forms */
.form-container { max-width: 760px; }
.form-card { background: #fff; padding: 40px; border-radius: 18px; box-shadow: 0 6px 30px rgba(0,0,0,.07); }
.form-card h2 { margin-bottom: 5px; }
.form-section { font-size: 17px; margin: 30px 0 15px; padding-bottom: 8px; border-bottom: 2px solid #f0f0f5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 10px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-group label small { color: #999; font-weight: 400; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 11px 14px; border: 2px solid #e3e3ea; border-radius: 10px; font-family: inherit; font-size: 15px; outline: none; transition: border-color .2s; background: #fff; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--pink); }
.form-group input:disabled { background: #f4f4f8; color: #777; }
.error { color: #d93025; font-size: 13px; margin-top: 4px; display: block; }
.form-card .btn-block { margin-top: 25px; padding: 14px; }
.back-link { color: var(--pink); font-size: 14px; font-weight: 500; display: inline-block; margin-bottom: 15px; }

/* Dashboard */
.alert-success { background: #e8f8ef; color: #1a7f45; padding: 14px 20px; border-radius: 10px; margin-bottom: 25px; }
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.company-card { background: #fff; padding: 28px; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,.06); display: block; transition: transform .3s, box-shadow .3s; border: 2px solid transparent; }
.company-card:hover { transform: translateY(-5px); border-color: var(--pink); }
.company-avatar { width: 52px; height: 52px; border-radius: 14px; background: var(--gradient); color: #fff; font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 15px; }
.company-card h3 { margin-bottom: 2px; }
.company-meta { display: flex; justify-content: space-between; align-items: center; margin: 15px 0; flex-wrap: wrap; gap: 8px; }
.plan-name { font-size: 14px; font-weight: 600; color: var(--blue); }
.status { font-size: 12px; padding: 4px 10px; border-radius: 20px; font-weight: 500; }
.status-trial { background: #fff4e5; color: #c66a00; }
.status-active { background: #e8f8ef; color: #1a7f45; }
.status-expired { background: #fdecec; color: #d93025; }
.open-link { color: var(--pink); font-weight: 600; font-size: 14px; }

@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-card { padding: 25px; }
}

/* Company Login */
.login-page { background: var(--gradient); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; width: 100%; max-width: 400px; padding: 40px 32px; border-radius: 20px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.login-card .form-group { text-align: left; margin-bottom: 16px; }
.login-avatar { margin: 0 auto 15px; width: 64px; height: 64px; font-size: 28px; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #555; margin-bottom: 5px; }
.login-card .btn-block { margin-top: 15px; padding: 13px; }
.login-card .back-link { margin-top: 18px; margin-bottom: 0; }
.powered { margin-top: 25px; font-size: 13px; color: #999; }
.powered .brand { font-size: 15px; }

/* Panel Layout */
.panel-body { display: flex; min-height: 100vh; background: #f5f6fa; }
.sidebar { width: 250px; background: #1f1f2b; color: #ccc; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; }
.sidebar-company { display: flex; align-items: center; gap: 12px; padding: 22px 18px; border-bottom: 1px solid #333; }
.sidebar-company .company-avatar { width: 42px; height: 42px; font-size: 18px; margin: 0; flex-shrink: 0; }
.sidebar-company strong { color: #fff; display: block; font-size: 15px; line-height: 1.3; }
.sidebar-company small { color: #FFB37A; font-size: 12px; }
.sidebar-menu { flex: 1; padding: 15px 10px; overflow-y: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; margin-bottom: 4px; font-size: 15px; transition: background .2s; }
a.menu-item:hover { background: #2c2c3c; color: #fff; }
.menu-item.active { background: var(--gradient); color: #fff; }
.menu-item.locked { opacity: .45; cursor: not-allowed; }
.menu-item .lock { margin-left: auto; font-size: 12px; }
.sidebar-footer { padding: 15px; font-size: 12px; text-align: center; border-top: 1px solid #333; }

.panel-main { flex: 1; margin-left: 250px; }
.topbar { background: #fff; padding: 18px 30px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.topbar h1 { font-size: 22px; }
.topbar-user { display: flex; align-items: center; gap: 15px; font-size: 14px; }
.topbar-user small { color: #888; }
.panel-content { padding: 30px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-bottom: 25px; }
.stat-card { background: #fff; padding: 22px; border-radius: 14px; display: flex; align-items: center; gap: 15px; box-shadow: 0 4px 15px rgba(0,0,0,.04); }
.stat-icon { font-size: 28px; width: 52px; height: 52px; border-radius: 12px; background: #f5f0ff; display: flex; align-items: center; justify-content: center; }
.stat-card small { display: block; color: #888; font-size: 13px; }
.stat-card strong { font-size: 20px; }
.panel-card { background: #fff; padding: 28px; border-radius: 14px; box-shadow: 0 4px 15px rgba(0,0,0,.04); }

@media (max-width: 900px) {
    .sidebar { display: none; }
    .panel-main { margin-left: 0; }
}

/* Forgot / Reset */
.forgot { margin-top: 15px; font-size: 14px; color: #888; }
.forgot a { color: var(--pink); font-weight: 500; }
.admin-option { display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px solid #e3e3ea; border-radius: 10px; margin-bottom: 10px; cursor: pointer; }
.admin-option:has(input:checked) { border-color: var(--pink); background: #fff5fa; }
.admin-option small { display: block; color: #888; }
.login-card .alert-success { font-size: 14px; padding: 10px 14px; margin-bottom: 15px; }

/* Panel pages */
.alert-error { background: #fdecec; color: #c62828; padding: 14px 20px; border-radius: 10px; margin-bottom: 25px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.page-header .muted { margin: 0; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { padding: 10px 14px; border: 2px solid #e3e3ea; border-radius: 10px; font-family: inherit; font-size: 14px; outline: none; background: #fff; }
.filter-bar input { flex: 1; min-width: 220px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--pink); }

.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 14px 18px; background: #fafafc; color: #777; font-weight: 500; border-bottom: 1px solid #eee; white-space: nowrap; }
.table td { padding: 14px 18px; border-bottom: 1px solid #f2f2f5; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.row-inactive { opacity: .55; }
.empty { text-align: center; color: #999; padding: 40px !important; }
.person { display: flex; align-items: center; gap: 12px; }
.person-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gradient); color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.person small { display: block; color: #999; font-size: 12px; }
.muted-inline { color: #999; font-size: 12px; }

.role { font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.role-admin { background: #f3e8ff; color: #7b2cbf; }
.role-manager { background: #e7f0ff; color: var(--blue); }
.role-staff { background: #f0f0f3; color: #555; }

.actions { white-space: nowrap; }
.actions form { display: inline; }
.btn-sm { display: inline-block; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; border: 1px solid #ddd; background: #fff; cursor: pointer; font-family: inherit; margin-left: 4px; }
.btn-sm:hover { border-color: var(--pink); color: var(--pink); }
.btn-sm-danger { color: #c62828; border-color: #f5c6c6; }
.btn-sm-success { color: #1a7f45; border-color: #bfe8d0; }

.panel-form { max-width: 820px; }
.panel-form .btn-primary { margin-top: 20px; }
.menu-item.soon { opacity: .45; }

.pagination-wrap { margin-top: 20px; }
.pagination { display: flex; gap: 10px; list-style: none; }
.pagination li a, .pagination li span { display: inline-block; padding: 8px 16px; border-radius: 8px; background: #fff; border: 1px solid #e3e3ea; font-size: 14px; }
.pagination li.disabled span { opacity: .5; }

/* Attendance */
.attendance-card { max-width: 520px; margin: 0 auto; text-align: center; }
.clock { font-size: 44px; font-weight: 700; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.today-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 25px; }
.today-status div { background: #f7f7fa; padding: 14px 8px; border-radius: 12px; }
.today-status small { display: block; color: #888; font-size: 12px; }
.today-status strong { font-size: 18px; }
.btn-punch { width: 100%; padding: 16px; font-size: 18px; }
.btn-out { background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.done-msg { color: #1a7f45; font-weight: 600; padding: 14px; background: #e8f8ef; border-radius: 12px; }
.camera-box video { width: 100%; max-width: 360px; border-radius: 16px; transform: scaleX(-1); background: #000; }
.camera-actions { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.punch-cell { display: flex; align-items: center; gap: 10px; }
.punch-cell small { display: block; color: #999; font-size: 12px; }
.selfie-thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; border: 2px solid #eee; }
.selfie-thumb:hover { border-color: var(--pink); }

/* Attendance tabs & monthly */
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab { padding: 9px 20px; border-radius: 10px; background: #fff; border: 1px solid #e3e3ea; font-weight: 500; font-size: 14px; }
.tab.active { background: var(--gradient); color: #fff; border-color: transparent; }

.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 15px; font-size: 13px; color: #666; }
.legend span { display: flex; align-items: center; gap: 6px; }

.month-table th, .month-table td { padding: 8px 4px; text-align: center; font-size: 13px; }
.month-table th small { color: #aaa; font-weight: 400; }
.month-table th.sun { color: #c66a00; }
.month-table .sticky-col { position: sticky; left: 0; background: #fff; text-align: left; padding: 10px 16px; min-width: 170px; z-index: 1; box-shadow: 2px 0 4px rgba(0,0,0,.04); }
.month-table thead .sticky-col { background: #fafafc; }
.month-table .sticky-col small { display: block; }
.month-table .total-col { background: #fafafc; min-width: 46px; }

.cell { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.cell-P { background: #e8f8ef; color: #1a7f45; }
.cell-L { background: #fff4e5; color: #c66a00; }
.cell-A { background: #fdecec; color: #d93025; }
.cell-S { background: #eef1ff; color: var(--blue); }
.cell-none { color: #ccc; }

/* Staff share */
.share-box { display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap; background: #fff; border: 2px dashed #f3c2dc; border-radius: 14px; padding: 16px 20px; margin-bottom: 20px; }
.share-box small { display: block; color: #888; font-size: 12px; }
.share-box code { display: block; font-size: 15px; color: var(--blue); font-weight: 600; margin: 2px 0; word-break: break-all; }
.btn-sm-wa { color: #128C7E; border-color: #bfe8d0; }
.btn-sm-wa:hover { color: #fff; background: #25D366; border-color: #25D366; }

/* Tasks */
.tab-count { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: rgba(0,0,0,.08); font-size: 12px; text-align: center; }
.tab.active .tab-count { background: rgba(255,255,255,.3); }

.task-list { display: grid; gap: 16px; }
.task-card { background: #fff; border-radius: 14px; padding: 20px 22px; box-shadow: 0 4px 15px rgba(0,0,0,.04); border-left: 5px solid #ddd; }
.task-card.is-overdue { border-left-color: #d93025; }
.task-card.done { opacity: .7; border-left-color: #1a9e55; }
.task-card.done h3 { text-decoration: line-through; }
.task-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.task-card h3 { font-size: 17px; margin-bottom: 4px; }
.task-desc { color: #666; font-size: 14px; white-space: pre-line; margin-bottom: 10px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: #555; margin-bottom: 10px; }
.task-meta .overdue { color: #d93025; font-weight: 600; }
.task-note { background: #f7f7fa; padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }

.prio { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.prio-high { background: #fdecec; color: #d93025; }
.prio-medium { background: #fff4e5; color: #c66a00; }
.prio-low { background: #eef1ff; color: var(--blue); }

.tstatus { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 20px; }
.tstatus-pending { background: #f0f0f3; color: #555; }
.tstatus-in_progress { background: #e7f0ff; color: var(--blue); }
.tstatus-completed { background: #e8f8ef; color: #1a7f45; }

.task-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid #f2f2f5; padding-top: 12px; }
.status-form { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.status-form select, .status-form input { padding: 7px 10px; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; font-size: 13px; outline: none; }
.status-form input { flex: 1; min-width: 180px; }
.status-form select:focus, .status-form input:focus { border-color: var(--pink); }
.manage-actions { display: flex; gap: 4px; }
.manage-actions form { display: inline; }

/* ===== Daily Reports ===== */
.report-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.report-layout .form-group { margin-bottom: 16px; }
.report-view h4 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 14px 0 4px; }
.report-view h4:first-child { margin-top: 0; }
.report-view p { white-space: pre-line; font-size: 14px; line-height: 1.6; }
.review-box { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: #E7F8F1; color: #0B6E4C; font-size: 14px; }
.review-box p { margin-top: 4px; color: var(--text); }
.issue-box { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: #FEF3E2; }
.issue-box h4 { margin-top: 0; color: #B45309; }
.report-photo { margin-top: 12px; max-width: 220px; border-radius: 12px; border: 1px solid var(--line); }

.history-row { padding: 12px 0; border-top: 1px solid #F0F1F6; }
.history-row:first-of-type { border-top: none; }
.hr-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.history-row p { font-size: 13px; color: var(--muted); }
.hr-note { margin-top: 6px; color: #0B6E4C !important; }

.report-list { display: grid; gap: 16px; }
.rc-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid #F0F1F6; }
.review-form { margin-top: 16px; padding-top: 14px; border-top: 1px solid #F0F1F6; }

@media (max-width: 1000px) {
    .report-layout { grid-template-columns: 1fr; }
}