@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* --- Base Styles & Variables --- */
:root {
    --primary: #4f46e5; /* Indigo 600 */
    --secondary: #10b981; /* Emerald 500 */
    --background: #f8f9fa;
    --text-color: #333;
    --border-color: #e5e7eb;
    --danger: #dc3545;
    --danger-bg: #f8d7da;
    --danger-border: #f5c6cb;
    --sidebar-width: 200px;
}



/* --- Theme Classes (From layout-three-colstyle) --- */
body.theme-light { background-color: #f9fafb; color: #111827; }
body.theme-dark { background-color: #111827; color: #f9fafb; }
body.theme-purple { background-color: #581c87; color: #f3e8ff; }
body.theme-green { background-color: #047857; color: #d1fae5; }

/* --- Headers --- */
.main-heading {
    font-size: 1.5em;
    font-weight: bold;
    
    padding: 0px 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.main-header {
    background-color: #0056b3;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-logo {
    font-size: 1.5em;
    font-weight: bold;
}

.header-link {
    color: #ffd700;
    text-decoration: none;
    padding: 5px;
}

.header-link:hover {
    text-decoration: underline;
}

/* --- Main Wrapper (Sidebar + Content) --- */
.main-wrapper {
    display: flex;
    flex: 1; 
    overflow: hidden;
    transition: all 0.3s;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: #343a40;
    padding-top: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    min-height: 100vh;
    transition: width 0.3s;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    padding: 15px 20px;
    color: #f8f9fa;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
    border-left: 5px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item:hover {
    background-color: #495057;
    border-left-color: #007bff;
}

.nav-item.active {
    background-color: #007bff;
    border-left-color: #ffd700;
    font-weight: bold;
    color: white;
}

/* --- Main Content Area --- */
.content-area {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.page-content-wrapper {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

/* --- Layout Specifics (3-Column) --- */
.layout-three-col { display: flex; gap: 20px; }
.layout-three-col .entry-form { width: 350px; border-right: 1px solid var(--border-color); padding: 10px; }
.layout-three-col .data-list { flex-grow: 1; padding: 10px; }

/* --- Footer --- */
.main-footer {
    background-color: #f8f9fa;
    color: #6c757d;
    text-align: center;
    padding: 10px;
    border-top: 1px solid #dee2e6;
    flex-shrink: 0;
}

/* --- Buttons --- */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s, opacity 0.2s;
    margin-bottom: 10px; 
}

.btn-primary { background-color: #007bff; color: white; }
.btn-secondary { background-color: #6c757d; color: white; }
.btn-danger { background-color: var(--danger); color: white; }
.btn-info { background-color: #17a2b8; color: white; }
.btn:hover { opacity: 0.9; }
.btn-small { padding: 5px 10px; font-size: 0.8em; margin-right: 5px; }
.btn-full-width { width: 100%; margin-top: 15px; }

.btn-indigo {
  /* bg-indigo-600 */
  background-color: #4f46e5;
  /* text-white */
  color: #ffffff;
  /* px-5 py-2 */
  padding: 0.5rem 1.25rem;
  /* rounded-lg */
  border-radius: 0.5rem;
  /* transition */
  transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  /* shadow-md */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
  /* font-semibold */
  font-weight: 600;
  /* hover:bg-indigo-700 */
}

.btn-indigo:hover {
  background-color: #4338ca;
}

/* --- Form Sections & Groups --- */
.form-section {
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

body.theme-light .form-section { background-color: rgba(0, 0, 0, 0.05); }
body.theme-dark .form-section { background-color: rgba(255, 255, 255, 0.05); }



/* --- Tables --- */
.asset-table, table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.85rem;
}

thead th {
    background-color: #e9ecef;
    padding: 12px;
    text-align: left;
    border-bottom: 3px solid #ddd;
    text-transform: uppercase;
    font-weight: 600;
}

tbody td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

body.theme-dark thead th { background-color: #374151; color: #cbd5e0; }
body.theme-dark tbody tr { background-color: #1f2937; }

/* --- Modals --- */
.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4); 
}
.modal-content {
    background-color: #fefefe; margin: 10% auto; padding: 20px; border: 1px solid #888; width: 90%; max-width: 500px; border-radius: 8px; position: relative;
    animation-name: animatetop; animation-duration: 0.4s;
}
@keyframes animatetop { from {top: -300px; opacity: 0} to {top: 0; opacity: 1} }
.close-btn { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; }

/* --- Scan Button Animation --- */
.scan-button {
    position: relative;
    padding: 5px 3px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    overflow: hidden;
    cursor: pointer;
}

.scan-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: scan 2s infinite linear;
}

@keyframes scan {
    0% { left: -100%; }
    100% { left: 100%; }
}
 .container {
        width: 100%;
		padding: 1rem;
    }
/* --- Flex Containers --- */
.flexcontainer { display: flex; gap: 10px; }
.flexcol { flex: 1; padding: 5px; }

/* --- Login Page --- */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 70vh;  }
.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}
.alert {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-danger { 
    color: var(--danger); 
    background-color: var(--danger-bg); 
    border-color: var(--danger-border); 
}
/* --- Responsive Layout Adjustments --- */
@media (max-width: 768px) {
    .main-wrapper { flex-direction: column; }
    .sidebar { width: 100%; height: auto; padding-top: 0; }
    .sidebar-nav { flex-direction: row; justify-content: space-around; border-bottom: 1px solid #495057; }
    .nav-item { padding: 10px 15px; text-align: center; border-left: none; border-bottom: 3px solid transparent; }
    .nav-item:hover, .nav-item.active { border-bottom-color: #ffd700; background-color: #495057; }
    
    .asset-table table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tr { margin-bottom: 15px; border: 1px solid #ddd; border-radius: 4px; padding: 10px; }
    td { text-align: right !important; border-bottom: 1px dotted #ccc; position: relative; padding-left: 50%; }
    td:before { content: attr(data-label); position: absolute; left: 10px; font-weight: bold; text-transform: uppercase; }

    .flexcontainer { flex-direction: column; }
}


/* ================================
   USER PERMISSION / ACCESS PAGE
================================ */

.permission-container {
    max-width: 1200px;
    padding: 1.5rem;
}

/* Header */
.permission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.permission-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Card */
.permission-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

/* Module header */
.permission-module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.2rem;
    background: var(--card-header-bg);
    cursor: pointer;
}

.module-title {
    font-weight: 600;
    color: var(--text-primary);
}

.module-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Toggle icon */
.toggle-icon {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Submodules */
.permission-submodule-list {
    padding: 0.8rem 1.5rem 1rem;
    background: var(--card-bg);
}

.submodule-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.submodule-item input {
    accent-color: var(--primary-color);
}

.no-submodule {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Footer */
.permission-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* Utility */
.hidden {
    display: none;
}
/* ================================
   USER PERMISSION / ACCESS PAGE End
================================ */

/* ================================
   "floating label, start
================================ */
/* =========================================================
   FLOATING LABEL FORM CSS
   Scoped safely to .form-group
   ========================================================= */

.form-group {
    position: relative;
    margin-bottom: 1.25rem;
}

/* INPUT / TEXTAREA / SELECT */
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 10px;
    font-size: 14px;
    background: transparent;
}

/* LABEL INSIDE FIELD */
.form-group label {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    padding: 0 6px;
    background: #ffffff;
    color: #6b7280;
    font-size: 14px;
    transition: all 0.2s ease;
}

/* FLOAT ON FOCUS OR VALUE */
.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -6px;
    font-size: 12px;
    color: #4f46e5;
}

/* DISABLED / READONLY */
.form-group input:disabled + label,
.form-group input[readonly] + label {
    color: #9ca3af;
}

/* DARK / COLORED BACKGROUNDS SAFETY */
.modal-content .form-group label,
.form-section .form-group label {
    background: inherit;
}

/* ==========================================
   FIX FLOATING LABEL SELECT HEIGHT & DROPDOWN
   ========================================== */

/* Select base fix */
.form-group select {
	width: 100%;
    padding: 10px 10px;
    height: 42px;
    line-height: 1.2;
    appearance: auto;          /* restore native dropdown */
    background-color: transparent;
}

/* Prevent label from increasing height */
.form-group select + label {
    top: 50%;
    transform: translateY(-50%);
}

/* Float label only when value selected */
.form-group select:focus + label,
.form-group select:not([value=""]) + label {
    top: -6px;
    font-size: 12px;
}

/* Prevent empty option from breaking */
.form-group select option[value=""] {
    display: none;
}
/* ================================
   "floating label, end
================================ */

/* ==============================
   TAB CONTAINER
================================ */
.tab-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    margin-top: 0;
}

/* ==============================
   TAB BUTTON
================================ */
.tab-btn {
    
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    
    border-bottom: 3px solid ;
    transition: all 0.25s ease;
    border-radius: 6px 6px 0 0;
    white-space: nowrap;
}



/* Active Tab */
.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: Red;
    background: var(--accent-color);
}

/* ==============================
   TAB CONTENT
================================ */
.tab-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}


/* ==============================
   ANIMATION
================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================
   MOBILE ACCORDION ADJUSTMENT (AUTO)
================================ */
@media (max-width: 768px) {

    .tab-container {
        flex-direction: column;
        border-bottom: none;
    }

    .tab-btn {
        width: 100%;
        text-align: left;
        border-radius: 6px;
        border: 1px solid var(--border-color);
        margin-bottom: 6px;
        background: var(--secondary-color);
    }

    .tab-btn.active {
        background: var(--primary-color);
        color: #fff;
        border-color: var(--primary-color);
    }

    .tab-content {
        border-radius: 6px;
        margin-bottom: 12px;
        border-top: 1px solid var(--border-color);
    }
}

.my-print-icon {
  font-size: 15px;
}

/*checklist*/
.drag-handle { cursor: grab; }
        .sortable-chosen { background-color: #f0fdf4; border: 1px solid #d1fae5; }
        .sortable-ghost { opacity: 0.5; background-color: #fef3c7; }
        
		.gridcontainer {
		  display: grid;
		  grid-template-columns: 2fr 2fr 1fr; /* Example: 1st and 3rd columns are 1 fraction unit, 2nd column is 2 fraction units */
		  gap: 20px; /* Optional: Add space between columns */
		}
		
		.flex-container {
				display: flex; /* Enables Flexbox for the container */
				flex-wrap: wrap; /* Allows columns to wrap to the next line on smaller screens */
				gap: 1rem; /* Adds space between columns (optional) */
			}

			.column {
				 padding: 1rem;
				background-color: #f0f0f0;
				border: 1px solid #ccc;
			}

			.left-column {
				flex: 2; /* Fixed width of 200px for the left column */
				/* flex-grow: 0, flex-shrink: 0, flex-basis: 200px */
			}

			.center-column {
				flex: 2; /* Allows the center column to grow and shrink to fill remaining space */
				/* flex-grow: 1, flex-shrink: 1, flex-basis: auto (or 0) */
				margin: 0 20px; /* Add some margin between columns */
			}

			.right-column {
				flex: 1; /* Fixed width of 150px for the right column */
			}

			/* Optional: Responsive adjustments using media queries */
			@media (max-width: 768px) {
				.flex-container {
					flex-direction: column; /* Stack columns vertically on smaller screens */
				}
				.column {
					width: 100%; /* Each column takes full width on small screens */
				}
				
			}
			
			.plus-icon-button {
				background-color: DodgerBlue; /* Blue background */
				border: none;
				color: white; /* White text/icon color */
				cursor: pointer; /* Changes cursor to a hand on hover */
				width: 30px; /* Square dimensions */
				height: 30px;
				display: flex; /* Centers the plus sign */
				justify-content: center;
				align-items: center;
				font-size: 30px; /* Size of the plus sign */
				border-radius: 5px; /* Optional: adds slightly rounded corners */
				text-decoration: none; /* Ensures no text decoration if wrapped in an <a> tag later */
			}

			.plus-icon-button:hover {
				background-color: RoyalBlue; /* Darker blue on hover */
			}

			/* Optional: remove the default blue highlight on mobile devices when tapped */
			.plus-icon-button {
				-webkit-tap-highlight-color: transparent; 
				user-select: none; /* Prevents text selection of the '+' sign */
			}
			
			.header-container {
				/* Aligns the heading and the button on the same line */
				display: flex;
				
					gap: 1rem; /* Adds space between the heading and the button */
				min-width: 0; / allows flex children to shrink properly / overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
			}
			
/*dashboard*/
.glass-card {
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(226, 232, 240, 0.8);
            box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .glass-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
        }

        .stat-badge {
            padding: 2px 8px;
            border-radius: 9999px;
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
        }

        .module-section {
            display: none; /* Controlled by JS permissions */
            animation: fadeIn 0.5s ease-out forwards;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Custom Scrollbar */
        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: #f1f5f9; }
        ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
		

/* gravience */
/* Custom Utility Classes */
.btn-action-base {
    @apply flex-1 font-bold py-4 rounded-xl border-2 transition duration-200 text-center;
}

/* Red / Reject Action */
.btn-reject {
    background-color: #fef2f2; /* red-50 */
    color: #dc2626;            /* red-600 */
    border-color: #fee2e2;     /* red-100 */
}
.btn-reject:hover {
    background-color: #fee2e2; /* red-100 */
}

/* Green / Approve Action */
.btn-approve {
    background-color: #059669; /* green-600 */
    color: #ffffff;
    border-color: #059669;
    box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.2);
}
.btn-approve:hover {
    background-color: #047857; /* green-700 */
}

/* Custom Multi-Tier Workspace Layout Classes */
.perm-card-block {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
    background-color: rgba(0, 0, 0, 0.015);
    transition: box-shadow 0.2s ease;
}
body.theme-dark .perm-card-block { background-color: rgba(255, 255, 255, 0.03); }
body.theme-purple .perm-card-block { background-color: rgba(255, 255, 255, 0.05); }

.perm-card-header {
    background-color: rgba(0, 0, 0, 0.04);
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    align-items: center;
    color: var(--text-color);
}
body.theme-dark .perm-card-header { background-color: rgba(0, 0, 0, 0.3); }

.perm-card-grid {
    padding: 0.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.perm-cb-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    color: var(--text-color);
}

.perm-cb-label input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary, #4f46e5);
}

.perm-error-alert {
    color: var(--danger, #dc3545);
    font-size: 0.75rem;
    font-style: italic;
    padding: 0.5rem;
    border: 1px dashed var(--danger, #dc3545);
    border-radius: 4px;
    background-color: rgba(220, 53, 69, 0.05);
}

/* Form Layout Classes */
.input-group { @apply mb-4; }
.label-sm { @apply block text-xs font-bold text-gray-500 uppercase mb-1; }
.input-field { @apply w-full border-2 p-3 rounded-lg bg-gray-50 focus:border-indigo-500 outline-none transition; }