@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Brand Colors */
    --primary: #2563eb;
    /* Vibrant Blue */
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    /* Cool Gray */
    --success: #10b981;
    /* Emerald */
    --danger: #ef4444;
    /* Rose */
    --warning: #f59e0b;
    /* Amber */
    --info: #3b82f6;
    /* Sky Blue */

    /* UI Colors */
    --bg-body: #f1f5f9;
    /* Light Slate Background */
    --bg-sidebar: #0f172a;
    /* Dark Slate */
    --bg-card: #ffffff;
    --text-main: #1e293b;
    /* Slate 800 */
    --text-secondary: #64748b;
    /* Slate 500 */
    --border-color: #e2e8f0;
    /* Slate 200 */

    /* Login Custom */
    --login-bg: #f8fafc;

    /* Spacing & Layout */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --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);

    /* Transitions */
    --transition: all 0.2s ease-in-out;
}

/* Global Reset & Typography */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

a:hover {
    text-decoration: none;
}

/* -----------------------
   Sidebar & Layout
----------------------- */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#content-wrapper {
    width: 100%;
    flex-grow: 1;
    margin-left: 250px;
    /* Offset for fixed sidebar */
}

.sidebar {
    background-color: var(--bg-sidebar) !important;
    background-image: none !important;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    width: 250px;
    min-width: 250px;
}

.sidebar-brand {
    height: 4.375rem;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05rem;
    color: #fff !important;
    text-transform: uppercase;
}

.sidebar-heading {
    color: #38bdf8 !important;
    /* Sky Blue */
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    margin: 1rem 1rem 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #1e293b;
    /* Slate 800 */
    border-radius: var(--radius-sm);
    display: block;
}

.sidebar .nav-item .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    border-radius: var(--radius-md);
    margin: 0 0.5rem;
    transition: var(--transition);
}

.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item.active .nav-link {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-item .nav-link i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    margin: 1rem 1.5rem !important;
}

/* -----------------------
   Cards & Content
----------------------- */
.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    overflow: hidden;
    /* For smooth corners */
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.card-header h6 {
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    margin: 0;
}

.topbar {
    height: 4.375rem;
    /* Match Sidebar Brand Height */
    display: flex;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

/* -----------------------
   Buttons
----------------------- */
.btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background-color: var(--danger);
}

.btn-success {
    background-color: var(--success);
}

/* -----------------------
   Tables
----------------------- */
.table {
    margin-bottom: 0;
    color: var(--text-main);
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    background-color: #f8fafc;
}

.table tbody td {
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    vertical-align: middle;
    font-size: 0.95rem;
}

/* Badges */
.badge {
    padding: 0.35em 0.8em;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-primary,
.badge-warning {
    background-color: #e0f2fe;
    color: #0369a1;
}

/* -----------------------
   Login Page
----------------------- */
.login-body {
    background-color: var(--login-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-card {
    background: #fff;
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-title {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.form-control {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    height: auto;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-footer {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Custom Scrollbar for Webkit */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Table sorting cursor */
.sorting-th {
    cursor: pointer;
    user-select: none;
}

.sorting-th:hover {
    background-color: #e2e8f0;
}

/* Make table rows darker on hover for readability */
.table-hover tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

/* Sticky top fix for tables inside overflow-auto */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Utility to ensure full height */
html,
body {
    height: 100%;
}

#wrapper {
    height: 100%;
    overflow: hidden;
}

#content-wrapper {
    height: 100%;
    overflow-y: auto;
}

#content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Adjust sidebar to not conflict with full height content if needed */
/* Result Row Styles - Active Items */
.result-row {
    background-color: #fff;
    color: var(--text-main);
}

.result-row:hover {
    background-color: #ebf8ff;
    /* Light Sky Blue */
}

/* Completed Row Styles */
.opacity-50 {
    opacity: 0.6;
}