/* Dashboard Moderno - Smart HR Style */
:root {
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3b82f6;
    --topbar-bg: #ffffff;
    --main-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --primary: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--main-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #ffffff;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--success);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    color: white;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav-item:hover {
    background-color: var(--sidebar-hover);
    color: white;
    border-left-color: var(--sidebar-active);
}

.sidebar-nav-item.active {
    background-color: var(--sidebar-hover);
    color: white;
    border-left-color: var(--sidebar-active);
}

.sidebar-nav-item i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Top Bar */
.topbar {
    background-color: var(--topbar-bg);
    padding: 20px 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.topbar-greeting {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.topbar-center {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.user-profile:hover {
    background-color: var(--main-bg);
}

.topbar-right a {
    text-decoration: none;
    color: inherit;
}

.topbar-right a:hover {
    text-decoration: none;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--info));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-add-new {
    background-color: var(--success);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-add-new:hover {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Content Area */
.content-wrapper {
    padding: 30px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.stat-icon.cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.stat-icon.yellow { background: linear-gradient(135deg, #eab308, #ca8a04); }

.stat-title {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    gap: 4px;
    line-height: 1.2;
}

.stat-value span:first-child {
    font-size: 14px;
    font-weight: 600;
}

.stat-change {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

.stat-chart {
    height: 40px;
    margin-top: 16px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
}

.stat-bar {
    flex: 1;
    background: linear-gradient(to top, var(--primary), rgba(59, 130, 246, 0.3));
    border-radius: 4px 4px 0 0;
    min-height: 4px;
}

/* Tables */
.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.table-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background-color: var(--main-bg);
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: var(--main-bg);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-red { background-color: #fee2e2; color: #dc2626; }
.badge-blue { background-color: #dbeafe; color: #2563eb; }
.badge-green { background-color: #d1fae5; color: #059669; }
.badge-orange { background-color: #fed7aa; color: #d97706; }
.badge-purple { background-color: #e9d5ff; color: #7c3aed; }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-action {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-view {
    background-color: var(--success);
    color: white;
}

.btn-view:hover {
    background-color: #059669;
}

.btn-edit {
    background-color: var(--info);
    color: white;
}

.btn-edit:hover {
    background-color: #2563eb;
}

.btn-delete {
    background-color: var(--danger);
    color: white;
}

.btn-delete:hover {
    background-color: #dc2626;
}

/* Calendar Widget */
.calendar-widget {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-month {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.calendar-day-header {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background-color: var(--main-bg);
}

.calendar-day.active {
    background-color: var(--primary);
    color: white;
}

.calendar-day.today {
    background-color: var(--success);
    color: white;
}

.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background-color: var(--success);
    border-radius: 50%;
}

/* Events Widget */
.events-widget {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-top: 24px;
}

.events-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.events-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.event-item:last-child {
    border-bottom: none;
}

.event-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.event-info {
    flex: 1;
}

.event-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.event-details {
    font-size: 12px;
    color: var(--text-secondary);
}

.event-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Grid Layout */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
}

@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .topbar-center {
        display: none;
    }
}

/* User Initial Circle */
.user-initial {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.user-initial.purple { background-color: #8b5cf6; }
.user-initial.brown { background-color: #a16207; }
.user-initial.yellow { background-color: #eab308; }
.user-initial.pink { background-color: #ec4899; }
.user-initial.red { background-color: #ef4444; }
.user-initial.gray { background-color: #6b7280; }
.user-initial.green { background-color: #10b981; }

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    position: relative;
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background-color: var(--main-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Bootstrap Modal Compatibility */
.modal.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
}

.modal.fade.show {
    opacity: 1;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Yellow icon color */
.stat-icon.yellow {
    background: linear-gradient(135deg, #eab308, #ca8a04);
}

