/* Sakthi Tyres ERP - Custom Modern CRM Styling */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --sidebar-bg: #0f172a;
    --sidebar-color: #94a3b8;
    --sidebar-active-bg: #1e293b;
    --sidebar-active-color: #38bdf8;
    --navbar-bg: #ffffff;
    --bg-light: #f8fafc;
    --card-border-radius: 12px;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-light);
    color: #334155;
    overflow-x: hidden;
}

/* Layout Structure */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

/* Sidebar Styles */
#sidebar {
    min-width: 260px;
    max-width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-color);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

#sidebar.toggled {
    margin-left: -260px;
}

#sidebar .sidebar-header {
    padding: 1.25rem 1.5rem;
    background: #090d16;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#sidebar .sidebar-header h4 {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    margin: 0;
    color: #f8fafc;
}

#sidebar .nav-link {
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-color);
    font-size: 0.92rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

#sidebar .nav-link:hover, #sidebar .nav-link.active {
    color: var(--sidebar-active-color);
    background: var(--sidebar-active-bg);
    border-left: 4px solid var(--sidebar-active-color);
}

#sidebar .nav-link i {
    font-size: 1.1rem;
}

#sidebar .sidebar-category {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    padding: 1.25rem 1.5rem 0.5rem;
    font-weight: 700;
}

/* Main Content Area */
#content-wrapper {
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navbar */
.top-navbar {
    background: var(--navbar-bg);
    box-shadow: var(--shadow-soft);
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.top-navbar .search-box {
    max-width: 320px;
    position: relative;
}

.top-navbar .search-box input {
    border-radius: 20px;
    padding-left: 2.2rem;
    font-size: 0.88rem;
    background-color: #f1f5f9;
    border: none;
}

.top-navbar .search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

/* Dashboard Cards */
.stat-card {
    border: none;
    border-radius: var(--card-border-radius);
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
}

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

.stat-card .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.bg-soft-primary { background: #dbeafe; color: #1d4ed8; }
.bg-soft-success { background: #dcfce7; color: #15803d; }
.bg-soft-warning { background: #fef3c7; color: #b45309; }
.bg-soft-danger { background: #fee2e2; color: #b91c1c; }
.bg-soft-info { background: #e0f2fe; color: #0369a1; }
.bg-soft-purple { background: #f3e8ff; color: #7e22ce; }

/* Custom Badge Styling */
.badge-soft {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 6px;
}

/* DataTables Styling */
.card-table {
    border: none;
    box-shadow: var(--shadow-soft);
    border-radius: var(--card-border-radius);
    overflow: hidden;
}

.table thead th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.85rem;
}

.table tbody td {
    padding: 0.85rem;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Mobile DataTables Card View Transformation */
@media (max-width: 767.98px) {
    #sidebar {
        margin-left: -260px;
    }
    #sidebar.toggled {
        margin-left: 0;
    }
    
    .table-mobile-cards thead {
        display: none;
    }
    
    .table-mobile-cards tbody tr {
        display: block;
        background: #ffffff;
        border-radius: 10px;
        box-shadow: var(--shadow-soft);
        margin-bottom: 12px;
        padding: 12px;
        border: 1px solid #e2e8f0;
    }
    
    .table-mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 6px 4px;
        text-align: right;
    }
    
    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 0.82rem;
        text-transform: uppercase;
        text-align: left;
        padding-right: 10px;
    }
}
