@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-main: #F8FAFC; /* Slate 50 */
    --bg-card: #FFFFFF;
    --text-primary: #0F172A; /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --accent-blue: #2563EB; /* Blue 600 */
    --accent-blue-hover: #1D4ED8; /* Blue 700 */
    --accent-purple: #4F46E5; /* Indigo 600 - safe mapping for old icon colors */
    --danger: #DC2626; /* Red 600 */
    --success: #16A34A; /* Green 600 */
    --warning: #D97706; /* Amber 600 */
    --border-color: #E2E8F0; /* Slate 200 */
    --sidebar-width: 250px;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --border-radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Corporate Dark Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #0F172A; /* Slate 900 */
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 50;
    border-right: 1px solid #1E293B;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #FFFFFF;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
    padding: 0.5rem;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-links a {
    color: #94A3B8; /* Slate 400 */
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease-in-out;
}

.nav-links a i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-links a:hover {
    color: #F8FAFC;
    background: #1E293B; /* Slate 800 */
}

.nav-links a.active {
    color: #FFFFFF;
    background: var(--accent-blue);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 2.5rem;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

/* Hides redundant internal main h2 headers */
main > div:first-child > h2 {
    display: none; 
}
main > div:first-child {
    display: flex;
    justify-content: flex-end !important;
    margin-bottom: 1.5rem !important;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    height: 100%;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Pulse animation for critical items */
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.pulse-critical {
    animation: pulse-red 2s infinite;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Polish Buttons */
.btn {
    background: var(--accent-blue);
    color: #fff;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn:hover {
    background: var(--accent-blue-hover);
}

.btn-secondary {
    background: #FFFFFF;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-secondary:hover {
    background: #F1F5F9;
}

/* Structured Forms */
.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.form-control::placeholder {
    color: #94A3B8;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Data Tables */
.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.875rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #F8FAFC;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

td {
    color: var(--text-primary);
    font-weight: 400;
    font-size: 0.875rem;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    background-color: #FFFFFF;
    transition: background-color 0.15s ease;
}

tbody tr:hover {
    background-color: #F1F5F9;
}

/* Solid Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.badge-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.badge-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.badge-danger { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

/* Metrics */
.metrics-value {
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0.5rem;
    line-height: 1;
}

/* Serious Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6); 
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.98);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.15s ease;
    display: flex;
}

.modal-close:hover {
    color: var(--danger);
}

.gradient-text {
    /* Removed gradients for corporate polish */
    color: var(--text-primary);
}
