:root {
    /* Color Palette */
    --primary: #059669; /* Emerald 600 */
    --primary-light: #10b981;
    --primary-dark: #064e3b;
    --accent: #f59e0b; /* Amber 500 */
    --bg-dark: #0f172a; /* Slate 900 */
    --bg-card: #1e293b; /* Slate 800 */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    
    /* Status Colors */
    --status-pending: #64748b;
    --status-recorded: #3b82f6;
    --status-otp: #f59e0b;
    --status-official: #10b981;

    --sidebar-width: 260px;
    --topbar-height: 70px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    overflow: hidden;
}

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
}

/* Layout */
.dashboard-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.logo {
    width: 40px;
    height: 40px;
}

.brand-text h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-light);
    letter-spacing: -0.5px;
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.side-nav {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item i {
    font-size: 1.1rem;
    width: 24px;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.top-bar {
    height: var(--topbar-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Progress Bar */
.progress-bar-container {
    height: 3px;
    width: 100%;
    background: transparent;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2000;
    overflow: hidden;
    display: none;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    box-shadow: 0 0 10px var(--primary-light);
    transition: width 0.3s ease;
}

/* Skeleton Loading */
.skeleton-row td {
    padding: 1.25rem 1.5rem;
}

.skeleton-text {
    height: 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    100% { left: 100%; }
}

.search-box {
    position: relative;
    width: 400px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--border);
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border-radius: 0.75rem;
    color: white;
    font-family: inherit;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.stats-badge {
    background-color: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
    font-size: 0.875rem;
}

.stats-badge .value {
    font-weight: 700;
    color: var(--primary-light);
    margin-left: 0.5rem;
}

/* Body Content */
.content-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-card.active {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.2);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-all { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.icon-recorded { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.icon-otp { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.icon-official { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-details h2 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-select {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

/* Cards & Tables */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.table-container {
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: rgba(255, 255, 255, 0.02);
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

th[data-sort] {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th[data-sort]:hover {
    color: var(--text-main);
}

th[data-sort] i {
    margin-left: 0.375rem;
    font-size: 0.65rem;
    opacity: 0.4;
    transition: opacity 0.15s;
}

th[data-sort].sort-active {
    color: var(--primary-light);
}

th[data-sort].sort-active i {
    opacity: 1;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem;
    color: var(--text-muted);
    gap: 0.75rem;
}

.empty-state i {
    font-size: 2rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.875rem;
    margin: 0;
}

td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Data Styles */
.pilgrim-info {
    display: flex;
    flex-direction: column;
}

.pilgrim-name {
    font-weight: 600;
    color: var(--text-main);
}

.pilgrim-ic {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.remark-preview {
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 0.375rem;
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 0.375rem;
    font-style: italic;
    background: rgba(245, 158, 11, 0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    border-left: 2px solid var(--accent);
}

.account-info {
    font-size: 0.875rem;
}

.account-th {
    color: var(--text-muted);
}

.package-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    background-color: rgba(148, 163, 184, 0.1);
    color: var(--text-main);
    display: inline-block;
}

/* Status Badges */
.status-pill {
    padding: 0.375rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-pending { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.status-pending::before { background: #f59e0b; }

.status-recorded { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }
.status-recorded::before { background: #3b82f6; }

.status-waiting_otp { background: rgba(139, 92, 246, 0.12); color: #a78bfa; }
.status-waiting_otp::before { background: #8b5cf6; }

.status-official { background: rgba(16, 185, 129, 0.1); color: #34d399; }
.status-official::before { background: #10b981; }

/* Actions */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: white;
    border-color: var(--text-main);
}

.btn-whatsapp {
    background-color: #25d366;
    border: none;
    color: white;
}

.btn-whatsapp:hover {
    background-color: #128c7e;
    transform: translateY(-2px);
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Responsive Customization */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-content h3 {
    padding: 1.5rem 1.5rem 0.5rem;
    font-size: 1.25rem;
    margin: 0;
}

.modal-content p {
    padding: 0 1.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.status-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 1.5rem 1.5rem;
}

.status-btn {
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.875rem;
}

.status-btn i {
    font-size: 1.1rem;
    opacity: 0.5;
}

.status-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.status-btn.active {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
}

.status-btn.active i {
    opacity: 1;
}

.modal-footer {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--border);
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    flex: 1;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.remarks-section {
    margin-bottom: 1.5rem;
}

.remarks-section label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.remarks-section textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    color: white;
    font-family: inherit;
    font-size: 0.875rem;
    resize: none;
    height: 80px;
}

.remarks-section textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-close {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.btn-close:hover {
    color: white;
}

.sidebar-footer .btn {
    width: 100%;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
