/* Glassmorphism 2.0 / Crystal Style Variables */
:root {
    /* BACKGROUND: Deep Aurora - Darker, richer, with moving gradients */
    --bg-dark: #020617;
    /* Slate 950 base */
    --bg-gradient-1: radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.15), transparent 40%);
    /* Cyan glow top left */
    --bg-gradient-2: radial-gradient(circle at 100% 0%, rgba(168, 85, 247, 0.15), transparent 40%);
    /* Purple glow top right */
    --bg-gradient-3: radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.15), transparent 40%);
    /* Blue glow bot right */

    /* GLASS PANELS: Thinner, Higher Blur, Multi-layered */
    --glass-surface: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    /* Top border highlight */
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --glass-inner-glow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);

    /* TEXT: High Contrast */
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    /* Slate 400 */

    /* ACCENTS: Neon / Glow */
    --primary-glow: 0 0 15px rgba(59, 130, 246, 0.5);
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --success: #10b981;

    /* BLUR STRENGTH */
    --blur-strength: 20px;
}

html,
body {
    height: 100%;
}

body {
    background-color: var(--bg-dark);
    background-image: var(--bg-gradient-1), var(--bg-gradient-2), var(--bg-gradient-3);
    background-attachment: fixed;
    /* Parallax-like fix */
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    margin: 0;
}

/* === LAYOUT UTILS (Ported from theme.css) === */
.container {
    max-width: 1400px;
    /* Wider for dashboard */
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-controls {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
    /* Prevent buttons from shrinking/wrapping */
}

.dashboard-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    display: flex;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    /* Allow title to wrap if absolutely necessary */
}

.dashboard-subtitle-wrapper {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8em;
    /* Slightly smaller to save space */
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.man-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.flex-row-center-gap {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.flex-col-gap-sm {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flex-row-between-center {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.w-100 {
    width: 100%;
}

.gap-xs {
    gap: 4px;
}

.w-auto {
    width: auto;
}

.w-sm {
    width: 90px;
    /* Reduced further */
}

.flex-nowrap {
    flex-wrap: nowrap !important;
}

/* New complimentary color */
.btn-purple {
    background: rgba(139, 92, 246, 0.2) !important;
    /* Violet */
    color: #a78bfa !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
}

.btn-purple:hover {
    background: rgba(139, 92, 246, 0.3) !important;
    border-color: #a78bfa !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2) !important;
}

.w-50px {
    width: 50px;
}

.max-w-150 {
    max-width: 150px;
}

.max-w-250 {
    max-width: 250px;
}

/* Manufacturer Card Alignment */
/* Old rule removed */

/* New Table Column Sizing */
.col-qty {
    width: 60px;
    text-align: center;
}

/* Swapped ID and Manufacturer logic handled in HTML, just sizing here */
.col-man {
    width: 140px;
    /* Manufacturer */
}

.col-id {
    width: 80px;
    /* ID Tag */
}

/* Ensure Rest of width goes to Model/Desc */
.col-model-desc {
    width: 350px;
    /* +30% wider */
    max-width: 350px;
}

/* Ghost buttons very faint */
.btn-ghost-disabled {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    /* Much more ghosted */
    cursor: not-allowed;
}

/* Specific solid success button for visibility */
.btn-success-solid {
    background: var(--success);
    color: white;
    border: none;
    font-weight: 500;
}

.btn-success-solid:hover {
    background: #059669;
    /* Darker green */
    transform: translateY(-1px);
}

/* Center the Spec Sheet Header and Content */
.col-specs {
    width: 220px;
    text-align: center;
}

.col-specs .actions-group {
    justify-content: center;
}




.data-table td.text-muted {
    /* Description text constraint */
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Shrink to fit content */
.data-table td:last-child {
    white-space: nowrap;
    width: 1%;
}

/* Sticky Bar */
.sticky-bar {
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
    z-index: 99;
    /* Enhance blur for floating bar */
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Ensure hidden works with specificity */
.hidden {
    display: none !important;
}

/* Text Truncation / Wrapping */
.text-truncate-sm {
    white-space: normal;
    /* Allow wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
    /* Remove single line constraint */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    /* Standard property */
    /* Limit to 3 lines if needed, or remove for full text */
    -webkit-box-orient: vertical;
    font-size: 0.9em;
    line-height: 1.4;
}

/* === GLASS COMPONENTS === */
/* Glass Panel 2.0 */
.glass-panel {
    background: var(--glass-surface);
    -webkit-backdrop-filter: blur(var(--blur-strength));
    backdrop-filter: blur(var(--blur-strength));

    border: 1px solid var(--glass-border);
    border-top-color: var(--glass-highlight);
    border-left-color: var(--glass-highlight);

    border-radius: 20px;
    box-shadow: var(--glass-shadow), var(--glass-inner-glow);

    padding: 24px;
    position: relative;
    overflow: hidden;
}

.border-active {
    border: 1px solid rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
}

/* Base Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons: Glowing, Floating */
.btn {
    height: 42px;
    /* Slightly taller */
    padding: 0 24px;
    border-radius: 12px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;

    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    /* Removed !important to allow overrides */
    color: white !important;
    /* Ensure text/emojis are visible */
    cursor: pointer;
}

.btn-header {
    height: 50px !important;
    font-size: 16px !important;
    text-align: center;
    justify-content: center;
    /* Ensure flex centering */
    white-space: nowrap !important;
    /* Prevent wrapping */
}


.btn-text {
    text-align: center;
    display: inline-block;
    /* Allow text wrapping behavior */
}

.btn-icon {
    display: flex;
    /* Ensure vertical centering */
    align-items: center;
}

/* Button Variations */
.btn-teal {
    background: rgba(45, 212, 191, 0.2) !important;
    color: #2dd4bf !important;
    border: 1px solid rgba(45, 212, 191, 0.3) !important;
}

.btn-teal:hover {
    background: rgba(45, 212, 191, 0.3) !important;
    box-shadow: 0 0 15px rgba(45, 212, 191, 0.2) !important;
    border-color: #2dd4bf !important;
}

.btn-green {
    background: rgba(16, 185, 129, 0.2) !important;
    /* Emerald green */
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.btn-green:hover {
    background: rgba(16, 185, 129, 0.3) !important;
    border-color: #34d399 !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2) !important;
}

.btn-red {
    background: rgba(239, 68, 68, 0.15) !important;
    /* Red/Danger */
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.btn-red:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: #fca5a5 !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2) !important;
}

.btn-info {
    background: rgba(56, 189, 248, 0.2) !important;
    /* Sky Blue */
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

.btn-info:hover {
    background: rgba(56, 189, 248, 0.3) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2) !important;
}

.btn-primary {
    /* Restoring the stronger gradient from original theme */
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.6);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-ghost-disabled {
    background: transparent;
    color: rgba(255, 255, 255, 0.4) !important;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    pointer-events: none;
    text-decoration: line-through !important;
    /* Force strikethrough */
    opacity: 0.5;
}

.actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    /* Prevent stacking */
    white-space: nowrap;
}

.upload-btn {
    /* Mimic btn-secondary but usually label */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.upload-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
}

/* Inputs: Deep Recessed Glass */
.form-input,
select,
.form-control {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--glass-border) !important;
    color: white !important;
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    width: 100%;
    padding: 0.75rem;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.2);
    outline: none;
}

/* Fix for Dropdown Options on Windows */
select option {
    background-color: #020617;
    /* Dark background matches theme */
    color: white;
}

/* Data Table: Floating Rows */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
}

.data-table {
    border-collapse: separate;
    border-spacing: 0 8px;
    /* Space between rows */
    width: 100%;
}

.data-table thead th {
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 0 1rem;
    border: none;
    white-space: nowrap;
    text-align: center;
    /* Center alignment */
}

.data-table tbody tr {
    background: rgba(255, 255, 255, 0.02);
    transition: transform 0.2s, background 0.2s;
}

.data-table tbody tr td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.data-table tbody tr td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(1.002);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.data-table td {
    border: none !important;
    padding: 0.5rem 0.5rem;
    /* Reduced padding to tighten spacing */
    vertical-align: middle;
    text-align: center;
    /* Center data */
}

/* Ensure left alignment for specific text blocks within centered cells if needed */
.text-left-force {
    text-align: left;
}

.text-truncate-sm {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
    /* text-align removed to inherit from td */
}

.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    text-align: center;
}

/* Badges: Glowing Pills */
.badge {
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Center text */
    min-width: 90px;
    /* Uniform width based on typical widest (e.g. MISSING) */
}

.badge-success-soft {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-info-soft {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-secondary-soft {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

/* Status Dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-dot.success {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.status-dot.warning {
    background: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
}

/* Modals: Clean Glass Overlay */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.6);
    display: none;
    overflow-y: auto;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #0f172a;
    /* Solid-ish dark backing */
    border: 1px solid var(--glass-highlight);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border-radius: 24px;
    padding: 2rem;
    width: 500px;
    max-width: 90%;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Man Cards */
.man-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    height: 100%;
}

.man-title-wrapper {
    /* Top alignment handled via margin-bottom on desc now if needed,
       but we want symmetry above/below text. */
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: auto;
}

.man-title {
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.2;
    padding-right: 0.5rem;
    max-width: 80%;
}

.man-desc-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Explicit class for Man Desc Text */
.man-desc-text {
    white-space: normal;
    /* Full wrap */
    overflow: visible;
    /* No hiding */
    display: block;
    /* No clamping */
    font-size: 0.9em;
    line-height: 1.4;
    color: var(--text-muted);
    /* Spacing: significantly reduced top margin, keep large bottom margin */
    margin-top: 0.5rem;
    margin-bottom: 1.6rem;
}

/* Actions Group (PDF Buttons) */
.actions-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    align-items: center;
}

.actions-group .btn {
    width: 100px;
    /* Uniform Fixed Width */
    height: 34px !important;
    /* Uniform Fixed Height */
    font-size: 0.8rem !important;
    /* Uniform text size */
    padding: 0;
    /* Remove padding to let flex justify center */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: white;
}

/* Hide Scrollbars */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
}

@supports (scrollbar-width: none) {
    .table-wrapper {
        scrollbar-width: none;
    }
}

.table-wrapper::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* Button Classes for Modals */
.bg-ghost {
    background: rgba(255, 255, 255, 0.05);
    /* Proper ghost background */
    color: white;
    /* Ensure visible text */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bg-ghost:hover {
    background: rgba(255, 255, 255, 0.15);
}

.text-white {
    color: white !important;
}

.bg-success {
    background-color: var(--success) !important;
}

.preview-label {
    font-size: 0.8em;
    opacity: 0.6;
}

.justify-center {
    justify-content: center;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-success {
    color: #10b981 !important;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.text-warning {
    color: #f59e0b !important;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.text-primary {
    color: var(--primary) !important;
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* End of File */