/* Modern Premium Aesthetics - Style for TaskMonitor Dashboard */

:root {
    --primary: #4f46e5;      /* Indigo */
    --primary-hover: #4338ca;
    --bg-color: #f8fafc;     /* Slate 50 */
    --card-bg: #ffffff;
    --text-main: #0f172a;    /* Slate 900 */
    --text-muted: #64748b;   /* Slate 500 */
    --border: #e2e8f0;       /* Slate 200 */
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --font: 'Plus Jakarta Sans', sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -4px rgba(0,0,0,0.05);
    
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.dashboard-container {
    display: flex;
    width: 100%;
}

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

.sidebar .logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    padding-left: 0.5rem;
}

.sidebar .logo i {
    color: var(--primary);
    font-size: 1.8rem;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links li.spacer {
    margin-top: auto;
    flex-grow: 1;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.nav-links a i {
    font-size: 1.25rem;
    transition: transform 0.3s;
}

.nav-links li.active a {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.nav-links a:hover:not(.active) {
    background: #f1f5f9;
    color: var(--text-main);
}

.nav-links a:hover:not(.active) i {
    transform: translateX(3px);
}

.text-danger { color: var(--danger) !important; }
.text-danger:hover { background: #fef2f2 !important; color: var(--danger) !important; }

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

/* Background Ornament */
.main-content::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 600px; height: 400px;
    background: radial-gradient(circle, rgba(79,70,229,0.08) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Topbar */
.topbar {
    height: 85px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 0;
    z-index: 5;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    padding: 0.75rem 1.25rem;
    border-radius: 100px;
    width: 380px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}
.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.search-bar i {
    color: var(--text-muted);
    margin-right: 0.75rem;
    font-size: 1.1rem;
}
.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notif-btn {
    position: relative;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
}
.notif-btn:hover { color: var(--text-main); }
.notif-btn .badge {
    position: absolute;
    top: -5px; right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid white;
}

.user-profile .avatar img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
}
.user-info strong {
    font-size: 0.95rem;
    color: var(--text-main);
}
.user-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Content Area */
.content {
    padding: 2.5rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.alert-warning {
    background: #fffbeb;
    border-left: 4px solid var(--warning);
    padding: 1rem 1.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #92400e;
    font-weight: 500;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
    margin-bottom: 0.4rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -5px rgba(79, 70, 229, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex; align-items: center; gap: 0.5rem;
    transition: all 0.2s;
}
.btn-outline:hover {
    background: #f1f5f9;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 1.75rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
}
.stat-card:nth-child(1)::before { background: #3b82f6; }
.stat-card:nth-child(2)::before { background: #f59e0b; }
.stat-card:nth-child(3)::before { background: #10b981; }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 65px;
    height: 65px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.bg-blue { background: #eff6ff; color: #3b82f6; }
.bg-orange { background: #fffbeb; color: #f59e0b; }
.bg-green { background: #ecfdf5; color: #10b981; }

.stat-info h3 {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-info h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

/* Table */
.table-container {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

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

.table-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th, .data-table td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table th {
    background: #f8fafc;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
}

.data-table th:first-child { border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.data-table th:last-child { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }

.data-table tbody tr {
    transition: background-color 0.2s;
}

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

.staff-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-weight: 600;
}
.staff-badge img {
    width: 28px; height: 28px;
    border-radius: 50%;
}

.message-cell {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-muted);
}

/* Badges */
.status-badge {
    padding: 0.4rem 0.85rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.status-pending { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }
.status-completed { background: #d1fae5; color: #059669; border: 1px solid #a7f3d0; }

.duration-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--primary);
    background: #e0e7ff;
    padding: 0.4rem 0.85rem;
    border-radius: 100px;
    font-size: 0.85rem;
    border: 1px solid #c7d2fe;
}

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

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

.modal-content {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.close {
    position: absolute;
    top: 1.5rem; right: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    background: #f1f5f9;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}
.close:hover { background: #e2e8f0; color: var(--text-main); }

.modal-header {
    margin-bottom: 2rem;
}
.modal-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.25rem;
}
.modal-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.form-group select, .form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: #f8fafc;
}

.form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.w-100 { width: 100%; justify-content: center; padding: 1rem; font-size: 1.05rem; }
