/* UltraUI Design System - Modernization 2025 */

:root {
    /* Palette - Brand */
    --color-ultra-green: #006627;
    --color-ultra-blue: #000FFF;

    /* Palette - Functional */
    --color-energy-orange: #E87722;
    --color-alert-red: #DC3545;
    --color-signal-green: #28A745;

    /* Palette - Neutrals */
    --color-off-white: #F5F7FAF;
    --color-deep-charcoal: #1D265D;
    --color-text-main: var(--color-deep-charcoal);
    --color-text-muted: #6c757d;
    --color-border: #dee2e6;

    /* Typography */
    --font-family-ui: 'Roboto', 'Open Sans', system-ui, sans-serif;
    --font-family-data: 'Fira Code', 'Roboto Mono', monospace;

    /* Layout Dimensions */
    --sidebar-width: 280px;
    --header-height: 70px;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: var(--font-family-ui);
    color: var(--color-text-main);
    background-color: var(--color-off-white);
    margin: 0;
    line-height: 1.5;
}

/* App Shell - CSS Grid Layout */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--header-height) 1fr;
    grid-template-areas:
        "sidebar header"
        "sidebar content";
    min-height: 100vh;
}

.app-sidebar {
    grid-area: sidebar;
    background-color: var(--color-deep-charcoal);
    color: white;
    position: fixed;
    height: 100vh;
    width: var(--sidebar-width);
    overflow-y: auto;
    z-index: 100;
}

.app-header {
    grid-area: header;
    background-color: white;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.app-content {
    grid-area: content;
    padding: 2rem;
    overflow-y: auto;
}

/* Typography Hierarchy */
h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-ultra-green);
    margin-bottom: 1rem;
}

h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-deep-charcoal);
    margin-bottom: 0.75rem;
}

/* Responsive Tables (Bento Box / Card View) */
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.responsive-table th,
.responsive-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.responsive-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--color-deep-charcoal);
}

.data-mono {
    font-family: var(--font-family-data);
}

/* Mobile Adaptation */
@media (max-width: 768px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-rows: var(--header-height) 1fr;
        grid-template-areas:
            "header"
            "content";
    }

    .app-sidebar {
        display: none;
        /* Control via JS to toggle */
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .app-sidebar.active {
        display: block;
        transform: translateX(0);
    }

    /* Responsive Table to Cards */
    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--color-border);
        border-radius: var(--border-radius);
        background: white;
        box-shadow: var(--box-shadow);
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--color-border);
    }

    .responsive-table td:last-child {
        border-bottom: none;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--color-text-muted);
        font-size: 0.9em;
        margin-right: 1rem;
    }
}

/* Utilities */
.btn-primary {
    background-color: var(--color-ultra-green);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #005020;
}

.badge {
    padding: 0.25em 0.6em;
    border-radius: 4px;
    font-size: 85%;
    font-weight: 700;
}

.badge-success {
    background-color: var(--color-signal-green);
    color: white;
}

.badge-warning {
    background-color: var(--color-energy-orange);
    color: white;
}

/* UltraUI - Premium Header & Sidebar Modernization */

.ultra-sidebar {
    background: linear-gradient(180deg, var(--color-deep-charcoal) 0%, #161c3d 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
}

.sidebar-user-section {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 10px;
}

.avatar-container img {
    border: 2px solid var(--color-ultra-green);
    padding: 2px;
    transition: transform 0.3s ease;
}

.avatar-container:hover img {
    transform: scale(1.05);
}

.status-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--color-deep-charcoal);
}

.status-indicator.online {
    background: var(--color-signal-green);
    box-shadow: 0 0 10px var(--color-signal-green);
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
}

.user-role {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-quick-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.user-quick-actions a {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transition: all 0.3s ease;
}

.user-quick-actions a:hover {
    background: var(--color-ultra-green);
    transform: translateY(-3px);
}

/* Header Styles */
.ultra-header {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    height: var(--header-height);
    padding: 0 20px;
}

.b-title {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--color-deep-charcoal);
    margin-left: 10px;
    letter-spacing: -0.5px;
}

.system-time-widget {
    background: rgba(0, 0, 0, 0.03);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-family-data);
    font-weight: 600;
    color: var(--color-ultra-green);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--color-deep-charcoal);
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-ultra-green);
}

.badge-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pulse {
    animation: shadow-pulse 2s infinite;
}

@keyframes shadow-pulse {
    0% {
        box-shadow: 0 0 0 0px rgba(220, 53, 69, 0.4);
    }

    100% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
}

/* Transitions */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}