:root {
    /* --- Main UI Palette --- */
    --brand-primary: #106EBE;
    /* Professional Azure Cobalt */
    --brand-accent: #00BCFF;
    /* Sky Blue Accent */
    --nav-bg: rgba(32, 31, 30, 0.85);
    /* Dark Slate Glass */
    --surface-glass: rgba(255, 255, 255, 0.82);
    --text-main: #201F1E;

    /* Legacy Azure compatibility */
    --azure-primary: var(--brand-primary);
    --azure-primary-hover: #005A9E;

    --text-primary: var(--text-main);
    --text-secondary: #605E5C;

    --bg-body: transparent;
    --bg-surface: var(--surface-glass);
    --bg-sidebar: var(--nav-bg);

    --border-color: rgba(225, 223, 221, 0.5);
    --divider-color: rgba(237, 235, 233, 0.3);

    /* Status Colors */
    --status-success-bg: #DFF6DD;
    --status-success-text: #107C10;
    --status-warning-bg: #FFF4CE;
    --status-warning-text: #797775;
    /* or #D83B01 for severe */
    --status-error-bg: #FDE7E9;
    --status-error-text: #A80000;

    /* Metrics */
    --radius-sm: 2px;
    --radius-md: 4px;
    /* Fluent UI uses smaller radii */
    --radius-lg: 8px;

    --shadow-depth-4: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.132), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.108);
    --shadow-depth-8: 0 3.2px 7.2px 0 rgba(0, 0, 0, 0.132), 0 0.6px 1.8px 0 rgba(0, 0, 0, 0.108);

    --font-family: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;

    --topbar-height: 48px;
    --sidebar-width: 250px;
}

/* Base Reset */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: transparent;
    color: var(--text-primary);
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    -webkit-font-smoothing: antialiased;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: url('../images/app-bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: blur(10px) brightness(0.92);
    transform: scale(1.05);
    /* Slight scale to hide blurred edges */
}

/* Optional: Dark overlay to ensure contrast */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: rgba(243, 242, 241, 0.4);
    /* Neutral wash */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    color: var(--text-main);
    font-weight: 700;
}

h2 {
    font-size: 20px;
    line-height: 28px;
}

h3 {
    font-size: 18px;
    line-height: 24px;
}

a {
    text-decoration: none;
    color: var(--azure-primary);
}

a:hover {
    color: var(--azure-primary-hover);
    text-decoration: underline;
}

/* --- Layout --- */
.main-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    /* Scroll handled internally */
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 16px;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.topbar-brand {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: white;
    text-decoration: none !important;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    color: #F3F2F1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
}

.sidebar .menu-title {
    padding: 24px 16px 8px 16px;
    font-size: 11px;
    text-transform: uppercase;
    color: #A19F9D;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar a.nav-link,
.sidebar .menu-item,
.sidebar .submenu-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #FFFFFF;
    text-decoration: none !important;
    font-size: 13px;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar a.nav-link:hover,
.menu-item:hover,
.submenu-item:hover {
    background-color: #3B3A39;
}

.sidebar a.nav-link.active,
.menu-item.active,
.submenu-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--brand-accent);
    color: var(--brand-accent);
}

.sidebar .submenu-item {
    padding-left: 40px;
    font-size: 12.5px;
    color: #D2D0CE;
}

.sidebar .submenu .submenu .submenu-item {
    padding-left: 60px;
}

.sidebar i {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
    opacity: 0.9;
}

.sidebar .arrow {
    margin-left: auto;
    font-size: 8px;
    transition: transform 0.2s;
}

.sidebar .arrow.rotate {
    transform: rotate(90deg);
}

/* Content Area */
.content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.page-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background-color: transparent;
}

/* Use this for the page title structure */
.azure-page-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
}

.azure-page-title-icon {
    width: 44px;
    height: 44px;
    background: var(--nav-bg);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 18px;
    color: var(--brand-accent);
    font-size: 22px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.azure-page-title {
    display: flex;
    flex-direction: column;
}

.azure-page-title h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #FFFFFF;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.azure-page-title .subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 400;
}

/* --- Components --- */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    /* 2px */
    font-weight: 600;
    padding: 6px 20px;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 20px;
}

.btn-primary {
    background-color: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    box-shadow: 0 2px 8px rgba(16, 110, 190, 0.3);
}

.btn-primary:hover {
    background-color: var(--azure-primary-hover);
    border-color: var(--azure-primary-hover);
    color: white;
    /* Ensure text stays white */
}

.btn-secondary {
    background-color: #FAF9F8;
    color: var(--text-primary);
    border-color: #D2D0CE;
}

.btn-secondary:hover {
    background-color: #EDEBE9;
    border-color: #A19F9D;
}

.btn-outline-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid #D2D0CE;
}

.btn-outline-secondary:hover {
    background-color: #F3F2F1;
    color: var(--text-primary);
    border-color: #8A8886;
}

.btn-danger {
    background-color: #A80000;
    color: white;
    border-color: #A80000;
}

.btn-danger:hover {
    background-color: #800000;
    border-color: #800000;
}

.btn-sm {
    padding: 3px 10px;
    font-size: 12px;
}

/* Button with icon adjustment */
.btn i {
    font-size: 14px;
}

.btn-sm i {
    font-size: 12px;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-depth-4);
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

/* Inputs */
.form-control {
    height: 34px;
    padding: 6px 12px;
    border: 1px solid #8A8886;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    background-color: #FFFFFF;
    transition: border-color 0.1s, box-shadow 0.1s;
}

.form-control:focus {
    border-color: var(--brand-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 188, 255, 0.2);
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.input-group {
    display: flex;
    width: 100%;
}

.input-group .form-control {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
    padding: 0 12px;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background-color: #F3F2F1;
    border: 1px solid #8A8886;
    border-right: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

select.form-control {
    padding-right: 24px;
}

/* Tables */
.table-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-depth-4);
    overflow-x:auto !important;
    border: 1px solid var(--border-color);
}

.azure-table {
    width: 100%;
    border-collapse: collapse;
}

.azure-table th {
    text-align: left;
    padding: 10px 16px;
    border-bottom: 1px solid var(--divider-color);
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    background: #FAFAFA;
}

.azure-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--divider-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.azure-table tbody tr:hover {
    background-color: #F3F2F1;
}

.azure-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.badge-danger {
    background: var(--status-error-bg);
    color: var(--status-error-text);
}

.badge-warning {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

/* Utilities */
.d-flex {
    display: flex !important;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 16px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 16px;
}

.mb-4 {
    margin-bottom: 24px;
}

.me-2 {
    margin-right: 8px;
}

.ms-auto {
    margin-left: auto;
}

.text-end {
    text-align: right;
}

.align-items-center {
    align-items: center;
}

/* Submenu/Tree Logic from previous sidebar, adapted */
.submenu {
    display: none;
    background: #1B1A19;
    flex-direction: column;
}

.submenu.open {
    display: flex;
}

/* Toggle Button */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: white;
    cursor: pointer;
}

@media(max-width: 768px) {
    .sidebar {
        position: fixed;
        height: 100%;
        z-index: 2200;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-toggle {
        display: block;
    }
}

.modal-dialog{
    top:50px;
}