/* ============================================================
   HRMS Custom Styles — IBS Beauty Theme (Magenta)
   ============================================================ */

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

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #2d0a2e;
    --sidebar-hover: #451446;
    --sidebar-active: #d6249f;
    --primary: #d6249f;
    --primary-dark: #b01e85;
    --primary-light: #fce4f3;
    --primary-gradient: linear-gradient(135deg, #d6249f, #8b1a6b);
    --accent: #ff69b4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #a855f7;
    --body-bg: #fdf2f8;
    --card-bg: #ffffff;
    --text-primary: #2d0a2e;
    --text-secondary: #7c6480;
    --border-color: #f0d4e8;
    --shadow-sm: 0 1px 3px rgba(214,36,159,0.06);
    --shadow-md: 0 4px 6px -1px rgba(214,36,159,0.1), 0 2px 4px -2px rgba(214,36,159,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(214,36,159,0.1), 0 4px 6px -4px rgba(214,36,159,0.06);
    --radius: 12px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: #fff;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    background: #fff;
    padding: 3px;
    flex-shrink: 0;
}

.sidebar-brand .brand-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.sidebar-brand h2 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    white-space: nowrap;
    line-height: 1.2;
}

.sidebar-brand small {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
}

.sidebar-nav .nav-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.3);
    padding: 16px 12px 8px;
    font-weight: 600;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: 0 4px 12px rgba(214,36,159,0.4);
}

.sidebar-nav .nav-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.sidebar-nav .nav-link .badge {
    margin-left: auto;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}

.sidebar-footer .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-footer .user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.sidebar-footer .user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.topbar {
    background: var(--card-bg);
    padding: 16px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.topbar .breadcrumb {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.content-area {
    padding: 28px;
}

/* ============================================================
   DASHBOARD CARDS
   ============================================================ */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #f0b4d8;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.stat-card .stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-card .stat-icon.green { background: #d1fae5; color: var(--success); }
.stat-card .stat-icon.yellow { background: #fef3c7; color: var(--warning); }
.stat-card .stat-icon.red { background: #fce7e7; color: var(--danger); }
.stat-card .stat-icon.cyan { background: #f3e8ff; color: var(--info); }

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================================
   TABLES
   ============================================================ */
.data-table {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.data-table .table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.data-table .table-header h5 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.data-table .table {
    margin: 0;
    font-size: 14px;
}

.data-table .table th {
    background: #fdf2f8;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table .table td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.data-table .table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: #fdf6fa;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(214,36,159,0.12);
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(214,36,159,0.3);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-sm {
    font-size: 12px;
    padding: 5px 12px;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    font-weight: 500;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 6px;
}

.bg-info {
    background-color: #a855f7 !important;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
    background-color: var(--primary);
}

.progress-bar.bg-success { background-color: var(--success) !important; }
.progress-bar.bg-warning { background-color: var(--warning) !important; }
.progress-bar.bg-danger { background-color: var(--danger) !important; }

/* ============================================================
   ALERTS - VISA EXPIRY
   ============================================================ */
.alert-card {
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    border: 1px solid;
}

.alert-card.alert-urgent {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-card.alert-warning {
    background: #fffbeb;
    border-color: #fed7aa;
    color: #92400e;
}

.alert-card i {
    font-size: 20px;
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2d0a2e 0%, #5a1a4a 35%, #8b1a6b 65%, #2d0a2e 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(214,36,159,0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(255,105,180,0.1) 0%, transparent 50%);
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(20px, -20px) rotate(2deg); }
    66% { transform: translate(-15px, 15px) rotate(-1deg); }
}

.auth-card {
    background: rgba(255,255,255,0.98);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px rgba(45,10,46,0.35);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.auth-card .auth-logo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    overflow: hidden;
}

.auth-card .auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-card .auth-logo .auth-logo-icon {
    width: 72px;
    height: 72px;
    background: var(--primary-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(214,36,159,0.35);
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.auth-card p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.auth-card .form-control {
    padding: 12px 16px;
    font-size: 14px;
}

.auth-card .btn-primary {
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    width: 100%;
}

.auth-card a {
    color: var(--primary);
}

.auth-card a:hover {
    color: var(--primary-dark);
}

.input-group-text {
    background: #fdf6fa;
    border-color: var(--border-color);
    color: var(--primary);
}

/* ============================================================
   MOBILE TOGGLE
   ============================================================ */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    z-index: 1100;
    box-shadow: 0 4px 15px rgba(214,36,159,0.4);
    cursor: pointer;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .topbar {
        padding: 14px 16px;
    }
    .topbar h1 {
        font-size: 18px;
    }
    .content-area {
        padding: 16px;
    }
    .stat-card {
        padding: 16px;
    }
    .stat-card .stat-value {
        font-size: 22px;
    }
    .auth-card {
        padding: 32px 24px;
    }
}

@media (max-width: 576px) {
    .data-table .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gap-3 { gap: 1rem; }

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
    color: var(--primary);
}

.empty-state h5 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Profile page */
.profile-header {
    background: var(--primary-gradient);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 32px 24px;
    color: #fff;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 12px;
    border: 3px solid rgba(255,255,255,0.3);
}

.profile-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-detail-row:last-child {
    border-bottom: none;
}

.profile-detail-row .label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.profile-detail-row .value {
    font-weight: 600;
    font-size: 14px;
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

/* Selection color */
::selection {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* Links */
a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-dark);
}

/* Modal */
.modal-header {
    background: #fdf6fa;
    border-bottom: 1px solid var(--border-color);
}
