/* assets/css/style.css */

/* Core variables & styling tokens */
:root {
    --bg-main: #f4f6fa;
    /* Clean grayish-blue background */
    --bg-surface: #ffffff;
    /* Pure white for cards/surfaces */
    --bg-surface-glass: #ffffff;
    --border-color: #e2e8f0;
    /* Very light slate border */
    --border-color-hover: #cbd5e1;
    /* Slightly darker gray border for hovers */

    --text-primary: #0a1c3f;
    /* Deep navy text color */
    --text-muted: #475569;
    /* Slate gray text */
    --text-dim: #64748b;
    /* Light slate text */

    /* Semantic Accents */
    --primary: #1e3a8a;
    /* Deep Brand Navy Blue */
    --primary-hover: #172554;
    /* Very dark navy */
    --primary-glow: rgba(30, 58, 138, 0.1);

    --danger: #dc2626;
    /* Solid Red */
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;

    --warning: #f1b813;
    /* Gold / Yellow Accent */
    --warning-bg: #fefbeb;
    --warning-border: #fde68a;

    --success: #16a34a;
    /* Solid Green */
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;

    --info: #2563eb;
    /* Solid Blue */
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-stack: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Reset and Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-stack);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Typography elements */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Layout Utilities */
.max-w-7xl {
    max-width: 80rem;
}

.w-full {
    width: 100%;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.p-6 {
    padding: 1.5rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

.space-y-6>*+* {
    margin-top: 1.5rem;
}

.space-y-8>*+* {
    margin-top: 2rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1 1 0%;
}

.min-h-screen {
    min-height: 100vh;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

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

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

.self-start {
    align-self: flex-start;
}

.hidden {
    display: none !important;
}

/* Responsive Media Queries for grids */
@media (min-width: 768px) {
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:flex-row {
        flex-direction: row;
    }

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

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lg\:col-span-1 {
        grid-column: span 1 / span 1;
    }

    .lg\:col-span-2 {
        grid-column: span 2 / span 2;
    }
}

/* Sidebar Layout System */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-main);
}

.main-content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sidebar {
    background-color: #0b1a3a;
    /* Very deep navy from screenshot */
    color: #ffffff;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.sidebar-logo-container {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.sidebar-logo-circle {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-logo-circle i {
    color: #0b1a3a;
    font-size: 1rem;
}

.sidebar-title-area {
    line-height: 1.2;
}

.sidebar-title-area h2 {
    font-size: 0.95rem;
    color: #ffffff;
    font-weight: 700;
}

.sidebar-title-area span {
    font-size: 0.7rem;
    color: #f1b813;
    /* Accredit gold */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
    border-left: 3px solid #f1b813;
}

/* Sidebar Responsive adjustment */
@media (min-width: 1024px) {
    .dashboard-layout {
        flex-direction: row;
    }

    .sidebar {
        width: 260px;
        height: 100vh;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.05);
        z-index: 40;
    }

    .sidebar-brand {
        margin-bottom: 2.5rem;
    }

    .sidebar-nav {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0.35rem;
    }

    .sidebar-link {
        width: 100%;
        padding: 0.75rem 1rem;
    }

    .main-content-wrapper {
        margin-left: 260px;
    }
}

/* Top bar style mapping the header profile details */
.top-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-header-title h2 {
    font-size: 1.15rem;
    color: var(--text-primary);
}

.top-header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-stack);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(30, 58, 138, 0.2);
}

.btn-secondary {
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.1);
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(220, 38, 38, 0.2);
}

.btn-success {
    background: var(--success);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(22, 163, 74, 0.1);
}

.btn-success:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -2px rgba(22, 163, 74, 0.2);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* Institutional Cards */
.glass-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all var(--transition-normal);
}

.glass-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color-hover);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    /* Soft light backgrounds matching the screenshot area badges */
    background: linear-gradient(135deg, #f1b813 0%, #d97706 100%);
    color: #ffffff;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-stack);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.file-input {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Clean Tables */
.overflow-x-auto {
    overflow-x: auto;
}

.table-v2 {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.table-v2 th,
.table-v2 td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table-v2 th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.775rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

.table-v2 tbody tr {
    background-color: #ffffff;
}

.table-v2 tbody tr:hover {
    background-color: #f8fafc;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.max-w-xs {
    max-width: 15rem;
}

/* Soft Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.725rem;
    font-weight: 600;
    line-height: 1;
}

.badge-slate {
    background-color: #e2e8f0;
    color: #334155;
}

.badge-indigo {
    background-color: var(--info-bg);
    border: 1px solid var(--info-border);
    color: var(--info);
}

.badge-success {
    background-color: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
}

.badge-warning {
    background-color: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: #b45309;
}

.badge-danger {
    background-color: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger);
}

.badge-info {
    background-color: var(--info-bg);
    border: 1px solid var(--info-border);
    color: var(--info);
}

/* Alerts */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.alert-success {
    background-color: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
}

.alert-error {
    background-color: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger);
}

/* Modals Overlay */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1.5rem;
}

.modal-content {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.max-w-lg {
    max-width: 32rem;
}

/* CSS-based heat map grid (5x5 matrix layout) */
.matrix-container {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 4px;
}

.matrix-cell {
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-sm);
    padding: 0.25rem;
    transition: all var(--transition-fast);
    position: relative;
    cursor: pointer;
    font-weight: 700;
}

.matrix-cell:hover {
    transform: scale(1.05);
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.matrix-cell .cell-count {
    font-size: 1.15rem;
    margin-top: 2px;
}

.matrix-cell .cell-coords {
    font-size: 0.55rem;
    opacity: 0.6;
}

/* Matrix coordinates mapping */
.cell-high {
    background-color: #ef4444;
    color: #ffffff;
}

.cell-medium {
    background-color: #f59e0b;
    color: #ffffff;
}

.cell-low {
    background-color: #10b981;
    color: #ffffff;
}

/* Login Page campus image overlay theme */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(15, 37, 87, 0.9) 0%, rgba(27, 53, 115, 0.9) 100%),
        url('../jrmsu_bg.jpg') no-repeat center center / cover;
    padding: 1.5rem;
}

.login-card {
    max-width: 26rem;
    width: 100%;
    background-color: #f3f4f6;
    /* Soft light gray card from screenshot */
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.login-card label {
    color: var(--text-muted);
    font-weight: 600;
}

.login-card input {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0b1a3a;
}

/* Tab details styling */
.tab-btn {
    border-top: none;
    border-left: none;
    border-right: none;
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

/* Utility space styles */
.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.pb-2 {
    padding-bottom: 0.5rem;
}

.pb-3 {
    padding-bottom: 0.75rem;
}

.pb-4 {
    padding-bottom: 1rem;
}

.pt-4 {
    padding-top: 1rem;
}

.border-b {
    border-bottom: 1px solid var(--border-color);
}

.border-t {
    border-top: 1px solid var(--border-color);
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.font-mono {
    font-family: monospace;
}

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

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

.text-indigo-400 {
    color: var(--primary);
}

.text-rose-400 {
    color: var(--danger);
}

.text-rose-500 {
    color: var(--danger);
}

.text-amber-400 {
    color: #b45309;
}

.text-amber-500 {
    color: #b45309;
}

.text-emerald-400 {
    color: var(--success);
}

.text-emerald-500 {
    color: var(--success);
}

.text-slate-400 {
    color: var(--text-muted);
}

.text-slate-500 {
    color: var(--text-dim);
}

.text-white {
    color: #fff;
}

.bg-clip-text {
    -webkit-background-clip: text;
    background-clip: text;
}

.text-transparent {
    color: transparent;
}

.rounded-xl {
    border-radius: var(--radius-md);
}

.gap-3 {
    gap: 0.75rem;
}

.w-10 {
    width: 2.5rem;
}

.h-10 {
    height: 2.5rem;
}

.text-xs {
    font-size: 0.75rem;
}

.sticky {
    position: sticky;
}

.top-0 {
    top: 0;
}

.z-50 {
    z-index: 50;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.rounded-lg {
    border-radius: var(--radius-sm);
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.rounded-xl {
    border-radius: var(--radius-md);
}

.border-dashed {
    border-style: dashed;
}

.text-4xl {
    font-size: 2.25rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

/* QA Specific Styles */
.qa-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .qa-grid-layout {
        grid-template-columns: 350px 1fr;
    }
}

.chart-card {
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.8rem;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Pagination container */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.pagination-link:hover,
.pagination-link.active {
    background-color: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}