/* Modern ERP System Styles - Redesigned */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Colors - Modern Blue */
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    
    /* Secondary Colors */
    --secondary-color: #0f172a;
    --secondary-light: #1e293b;
    
    /* Status Colors */
    --success-color: #059669;
    --success-light: #10b981;
    --success-bg: #ecfdf5;
    
    --danger-color: #dc2626;
    --danger-light: #ef4444;
    --danger-bg: #fef2f2;
    
    --warning-color: #d97706;
    --warning-light: #f59e0b;
    --warning-bg: #fffbeb;
    
    --info-color: #0284c7;
    --info-light: #0ea5e9;
    --info-bg: #f0f9ff;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --footer-height: 56px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    font-size: 13px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="90" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.login-box {
    background: var(--white);
    padding: 48px;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    color: var(--gray-900);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.login-box p {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 32px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 400;
    transition: var(--transition);
    background: var(--white);
    color: var(--gray-900);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    background: var(--success-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: var(--danger-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-warning:hover {
    background: var(--warning-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-info {
    background: var(--info-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-info:hover {
    background: var(--info-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 14px;
    border-radius: var(--border-radius-lg);
}

.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    border-left: 4px solid;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-color);
    border-left-color: var(--danger-color);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-color);
    border-left-color: var(--success-color);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-color);
    border-left-color: var(--warning-color);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info-color);
    border-left-color: var(--info-color);
}

/* ==================== MAIN LAYOUT ==================== */
.dashboard-container {
    display: grid;
    grid-template-areas:
        "sidebar header"
        "sidebar content"
        "sidebar footer";
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--header-height) 1fr var(--footer-height);
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    background: var(--gray-50);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    grid-area: sidebar;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
    color: white;
    letter-spacing: -0.5px;
}

.sidebar-header p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-menu-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav-scroll::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-menu {
    list-style: none;
    padding: 12px 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 2px;
    padding: 0 16px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--border-radius);
    position: relative;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
}

.nav-link.active {
    background: rgba(79, 70, 229, 0.2);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: #818cf8;
    border-radius: 0 2px 2px 0;
}

.nav-link span {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.user-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin: 0 0 2px 0;
}

.user-details p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    text-transform: capitalize;
}

.logout-btn-sidebar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.logout-btn-sidebar:hover {
    background: rgba(220, 38, 38, 0.25);
    color: #fee2e2;
    border-color: rgba(220, 38, 38, 0.5);
}

/* ==================== HEADER (TOPBAR) ==================== */
.topbar {
    grid-area: header;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 32px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    z-index: 50;
}

.topbar h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

/* ==================== MAIN CONTENT AREA ==================== */
.main-content {
    grid-area: content;
    background: var(--gray-50);
    overflow-y: auto;
    overflow-x: hidden;
}

.content {
    padding: 32px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ==================== FOOTER ==================== */
.main-footer {
    grid-area: footer;
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 0 32px;
    display: flex;
    align-items: center;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.04);
    z-index: 50;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-left p {
    margin: 0;
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    font-weight: 500;
}

.footer-right span {
    color: var(--gray-500);
}

.footer-divider {
    color: var(--gray-300);
}

.footer-right a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 32px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
}

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

.stat-card.success::before {
    background: linear-gradient(90deg, var(--success-color), var(--success-light));
}

.stat-card.danger::before {
    background: linear-gradient(90deg, var(--danger-color), var(--danger-light));
}

.stat-card.warning::before {
    background: linear-gradient(90deg, var(--warning-color), var(--warning-light));
}

.stat-card.info::before {
    background: linear-gradient(90deg, var(--info-color), var(--info-light));
}

.stat-label {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* Card */
.card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 32px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    letter-spacing: -0.025em;
}

.card-body {
    padding: 32px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

table thead {
    background: var(--gray-50);
}

table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 13px;
}

table tbody tr:hover {
    background: var(--gray-50);
}

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

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-color);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-color);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-color);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info-color);
    border: 1px solid rgba(2, 132, 199, 0.2);
}

/* Form Layouts */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

/* Search and Filter Bar */
.search-filter-bar {
    background: var(--white);
    padding: 16px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-input .form-control {
    padding-left: 44px;
}

.search-input::before {
    content: '🔍';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    z-index: 1;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-group label {
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
}

.filter-select {
    min-width: 150px;
}

/* Product Cards */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    height: fit-content;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.product-image {
    position: relative;
    height: 160px;
    background: var(--gray-100);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.03);
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-400);
}

.no-image span {
    font-size: 32px;
}

.product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-badges .badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
}

.product-info {
    padding: 16px;
}

.product-header {
    margin-bottom: 12px;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 3px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-code {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-details {
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.detail-row .label {
    color: var(--gray-600);
    font-weight: 500;
}

.detail-row .value {
    color: var(--gray-900);
    font-weight: 600;
}

.detail-row .value.stock-low {
    color: var(--danger-color);
}

.detail-row .value.stock-good {
    color: var(--success-color);
}

.detail-row .value.price {
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 700;
}

.product-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.product-actions .btn {
    flex: 1;
    min-width: 0;
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 500;
}

/* Form Sections */
.form-section {
    margin-bottom: 32px;
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.form-section:last-of-type {
    margin-bottom: 24px;
}

.text-muted {
    color: var(--gray-500);
    font-size: 12px;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-xl);
    padding: 40px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
}

.modal-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}

.close-modal {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: var(--gray-400);
    transition: var(--transition);
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 12px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.p-5 { padding: 32px; }

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }
.gap-5 { gap: 32px; }

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 200px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 20px;
    }
    
    .topbar {
        padding: 16px 20px;
    }
    
    .topbar h1 {
        font-size: 18px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .card-header,
    .card-body {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 12px 16px;
    }
    
    .sidebar-footer {
        padding: 16px;
    }
    
    .user-profile {
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .user-details h4 {
        font-size: 13px;
    }
    
    .user-details p {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 32px 24px;
        margin: 20px;
    }
    
    .modal-content {
        padding: 24px;
        margin: 20px;
    }
    
    .search-filter-bar {
        padding: 16px 20px;
    }
    
    .card-header,
    .card-body {
        padding: 16px;
    }
}


