/* Global Styles */
:root {
    --brand-primary: #C31230;
    --brand-secondary: #E31837;
    --brand-light: #E14B62;
    --brand-dark: #7A0B1F;
    --accent-orange: #ff6b35;
    --success-green: #28a745;
    --warning-yellow: #ffc107;
    --danger-red: #dc3545;
    --text-dark: #1a1a1a;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--brand-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-secondary);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--brand-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--brand-secondary);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(195, 18, 48, 0.25);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 14px 28px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(195, 18, 48, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #dee2e6;
    font-size: 1rem;
    font-weight: 600;
    padding: 14px 28px;
    letter-spacing: 0.3px;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-green);
    color: white;
}

.btn-danger {
    background: var(--danger-red);
    color: white;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    background: var(--bg-white);
}

input[type="file"].file-input {
    padding: 10px;
    cursor: pointer;
}

input[type="file"].file-input::-webkit-file-upload-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: white;
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9rem;
}

input[type="file"].file-input::-webkit-file-upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(195, 18, 48, 0.3);
}

/* Firefox */
input[type="file"].file-input::file-selector-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: white;
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9rem;
}

input[type="file"].file-input::file-selector-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(195, 18, 48, 0.3);
}

.help-text {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

.file-info {
    margin-top: 8px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-info i {
    color: var(--success-green);
}

.file-info.error {
    background: #fff3cd;
    color: #856404;
}

.file-info.error i {
    color: var(--danger-red);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px rgba(195, 18, 48, 0.1);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

label i {
    color: var(--brand-primary);
    font-size: 1rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    margin-bottom: 10px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

/* Loading Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--brand-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--success-green);
}

.toast.error {
    border-left: 4px solid var(--danger-red);
}

.toast.warning {
    border-left: 4px solid var(--warning-yellow);
}

.toast.info {
    border-left: 4px solid var(--brand-light);
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .card {
        padding: 16px;
    }
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #d4edda;
    color: var(--success-green);
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: var(--danger-red);
}

.badge-info {
    background: #FDE8EC;
    color: #7A0B1F;
}

.badge-primary {
    background: #FDE8EC;
    color: var(--brand-primary);
}


/* TJX Canada logo chip (white backing so the red logo reads on dark surfaces) */
.logo-badge {
    display: inline-block;
    background: #ffffff;
    border-radius: 10px;
    padding: 8px 12px;
    line-height: 0;
}
.logo-badge img {
    height: 56px;
    display: block;
}

/* Truncated description cells in project tables (hover for full text) */
.desc-cell {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-light);
    font-size: 0.88rem;
}
/* Role tag under the user name in the sidebar — hidden per management request.
   The element stays in the DOM because page scripts write to #userRole. */
.user-role {
    display: none !important;
}
/* Sortable table headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th.sortable:hover {
    filter: brightness(1.12);
}

th.sortable .sort-icon {
    opacity: 0.45;
    margin-left: 5px;
    font-size: 0.85em;
}

th.sortable.sorted .sort-icon {
    opacity: 1;
}