@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4F46E5;
    --primary-dark: #4338ca;
    --secondary: #ec4899;
    --dark: #0f172a;
    --light: #f8fafc;
    --white: #ffffff;
    --gray: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-width: 260px;
    --header-height: 70px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #f1f5f9;
    color: var(--dark);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: var(--white);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    transition: 0.3s;
    font-weight: 500;
    position: relative;
    /* Anchor for absolute elements */
}

/* ... existing hover styles ... */

/* ... (Collapsed state section) ... */

/* Optional: Adjust count position */
.sidebar.collapsed .sidebar-menu a .count {
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 2px 4px;
    font-size: 0.6rem;
    border-radius: 5px;
    /* Softer look */
    min-width: 16px;
    /* Ensure visibility for 1 digit */
    text-align: center;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border-right: 4px solid var(--primary);
}

.sidebar-menu a i {
    margin-right: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-menu .count {
    margin-left: auto;
    background: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Header */
.top-header {
    height: var(--header-height);
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-bottom: var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notifications-item {
    position: relative;
    cursor: pointer;
    color: var(--dark);
    font-size: 1.2rem;
}

.notifications-item .notification-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 50%;
    min-width: 16px;
    text-align: center;
}

.toggle-sidebar {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--dark);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* Page Content */
.content {
    padding: 2rem;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Tables */
.table-container {
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    font-weight: 600;
    color: var(--gray);
    background: #f8fafc;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Modal / Popup */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 600px;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    animation: slideIn 0.3s ease;
    overflow: hidden;
    /* User request: compact and padding/margin on all sides */
    margin: 20px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
}

.close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    padding: 1.5rem;
    padding-bottom: 2rem;
    overflow-y: auto;
    flex: 1;
    /* Ensure it takes available space */
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    /* Compact padding */
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: #f8fafc;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        left: -100%;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }
}

/* Sidebar Collapsed State (Desktop) */
@media (min-width: 769px) {
    .sidebar.collapsed {
        width: 70px;
    }

    .sidebar.collapsed .sidebar-header span {
        display: none;
    }

    .sidebar.collapsed .sidebar-menu a {
        justify-content: center;
        padding: 0.8rem;
    }

    .sidebar.collapsed .sidebar-menu a i {
        margin-right: 0;
        font-size: 1.25rem;
    }

    /* Hide the text span */
    .sidebar.collapsed .sidebar-menu a span:not(.count) {
        display: none;
    }

    /* Optional: Adjust count position */
    .sidebar.collapsed .sidebar-menu a .count {
        position: absolute;
        top: 2px;
        right: 2px;
        padding: 2px 4px;
        font-size: 0.6rem;
        border-radius: 5px;
        min-width: 16px;
        text-align: center;
    }

    .main-content.collapsed {
        margin-left: 70px;
    }

    .sidebar.collapsed .logo-text {
        display: none;
    }

    .sidebar.collapsed .sidebar-header {
        justify-content: center;
        padding: 0;
    }
}

/* Step Wizard Styles */
.step-dot {
    flex: 1;
    padding: 10px;
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s;
}

.step-dot.active {
    background: var(--primary);
    color: white;
}

.step-dot:hover:not(.active) {
    background: #e2e8f0;
}