:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #2c3e50;
    --light-bg: #f5f6fa;
    --white: #ffffff;
}

* {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
}

body {
    background: var(--light-bg);
    color: var(--text-color);
    font-size: 0.9rem;
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: var(--light-bg);
    min-height: calc(100vh - 60px);
    overflow-x: hidden;
}

.content-wrapper {
    padding: 1.5rem 1rem;
    overflow-x: auto;
}

/* Cards & Containers */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
}

/* Tables Responsive Container */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}

/* Global Table Styling */
.main table {
    width: 100% !important;
    table-layout: fixed;
    border-collapse: collapse;
}

.card table {
    width: 100% !important;
    table-layout: fixed;
    border-collapse: collapse;
}

/* Tables */
table {
    font-size: 0.8rem;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

table thead {
    background: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

table thead th {
    border: none;
    font-weight: 600;
    padding: 0.6rem 0.5rem;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    min-width: 80px;
}

table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

table tbody tr:hover {
    background: rgba(52, 152, 219, 0.05);
}

table tbody td {
    padding: 0.5rem 0.4rem;
    vertical-align: middle;
    border-color: rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    word-break: break-word;
    min-width: 80px;
}

/* Column width constraints */
table th,
table td {
    min-width: 80px;
    max-width: 200px;
}

/* Smaller columns for specific use cases */
table th.col-sm,
table td.col-sm {
    min-width: 60px;
    max-width: 100px;
}

/* Regular columns */
table th.col-md,
table td.col-md {
    min-width: 100px;
    max-width: 150px;
}

/* Wider columns for names and descriptions */
table th.col-lg,
table td.col-lg {
    min-width: 150px;
    max-width: 250px;
}

/* Make all parent containers of tables scrollable */
.main > table,
.card > table,
.table-bordered,
.table-striped {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--accent-color);
    border: none;
}

.btn-primary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    border: none;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    border: none;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}

.btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Forms */
.form-control,
.form-select {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 1rem;
    font-size: 0.85rem;
}

.modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 6px;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: #27ae60;
    background: #d5f4e6;
    color: #27ae60;
}

.alert-danger {
    border-left-color: #e74c3c;
    background: #fadbd8;
    color: #c0392b;
}

.alert-warning {
    border-left-color: #f39c12;
    background: #fdebd0;
    color: #d68910;
}

.alert-info {
    border-left-color: #3498db;
    background: #d6eaf8;
    color: #2874a6;
}

/* Badges */
.badge {
    border-radius: 20px;
    padding: 0.35rem 0.6rem;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Pagination */
.pagination {
    gap: 0.5rem;
}

.page-link {
    border: 1px solid #ddd;
    border-radius: 4px;
    color: var(--accent-color);
    transition: all 0.2s ease;
}

.page-link:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.page-item.active .page-link {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* Utility Classes */
.main {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    width: 100%;
    margin-top: 0;
}

.button_sec {
    display: flex !important;
    gap: 1rem;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 1rem;
    }

    .button_sec {
        flex-direction: column;
        align-items: stretch !important;
    }

    table {
        font-size: 0.85rem;
    }

    table thead th,
    table tbody td {
        padding: 0.5rem !important;
    }
}

.allocated-tablenew {
    width: 100%;
}

.allocated-tablenew td, .allocated-tablenew th {
    border: none;
    padding: 8px;
    text-align: left;
    font-size: 14px;
}

.allocated-tablenew h5 {
    margin-bottom: 5px;
}
.tablenew td{
    border: 1px solid rgb(158, 158, 158);
}

.modalcon{
    width: auto !important;
}
.large-header th {
    font-size: 13px; 
}
.w-5{
    width: 50px !important;
    height: 50px !important;
}

.leading-5{
    margin-top: 20px !important;
}