:root {
    --primary: #4f46e5; /* Indigo */
    --primary-hover: #4338ca;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --glass: rgba(255, 255, 255, 0.7);
    --border: #e2e8f0;
    --sidebar: #111827;
}

body {
    background-color: #f5f6f8;
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    margin: 0;
    overflow-x: hidden;
}

/* Layout Wrappers */
.main-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #2b2d42;
    color: #a3a6b4;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s;
}

.sidebar .sidebar-brand {
    height: 70px;
    background-color: #232436;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
}

.sidebar .sidebar-brand i { /* Tarsus Logo Icon placeholder */
    font-size: 1.8rem;
    margin-right: 10px;
}

.sidebar .menu-label {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c7293;
}

.sidebar .nav-item {
    margin: 0.2rem 1rem;
}

.sidebar .nav-link {
    color: #a3a6b4;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}
.sidebar .nav-link.active {
    border-left: 3px solid #8884d8;
    background-color: rgba(136, 132, 216, 0.1);
}

/* Content Area */
.content-wrapper {
    flex: 1;
    margin-left: 260px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: all 0.3s;
}

/* Top Header */
.top-header {
    height: 70px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    z-index: 999;
}

.top-header .search-bar {
    background: #f1f3f5;
    border-radius: 20px;
    padding: 0.4rem 1rem;
    display: flex;
    align-items: center;
    width: 300px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.top-header .search-bar:focus-within {
    background: #ffffff;
    border-color: #d1d5db;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.top-header .search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    margin-left: 10px;
    font-size: 0.9rem;
}

.top-header-tools {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.main-content {
    padding: 2rem;
    flex: 1;
}

/* Glass Card */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.glass-card:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Premium Buttons */
.btn-premium {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px var(--primary);
    filter: brightness(1.1);
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-draft { background: #e2e8f0; color: #475569; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* Tables matching the UI image */
table.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

table.table thead th {
    background-color: #2b2d42;
    color: #ffffff;
    font-weight: 500;
    padding: 1rem;
    border-bottom: none;
}

table.table thead th i {
    font-size: 0.8rem;
    margin-left: 5px;
    color: #a3a6b4;
}

table.table tbody tr {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
}

table.table tbody tr:nth-of-type(even) {
    background-color: #fbfbfb;
}

table.table tbody tr:hover {
    background-color: #f4f6fb;
}

table.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Redesign for glass-card flat look */
.glass-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 1.5rem;
    border: 1px solid #ebedf2;
    transition: none;
}
.glass-card:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Overwrite default pop effect */
}

/* Square/solid buttons from UI image */
.btn-ui-action {
    border-radius: 4px;
    padding: 0.35rem 0.6rem;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
}
.btn-ui-action.btn-ui-green { background-color: #20c997; border: 1px solid #20c997; }
.btn-ui-action.btn-ui-blue { background-color: #6366f1; border: 1px solid #6366f1; }
.btn-ui-action.btn-ui-red { background-color: #ef4444; border: 1px solid #ef4444; }

/* Unit Checkbox Tree Component */
.unit-tree-container {
    background-color: #fcfcfd;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.unit-tree {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.unit-tree-item {
    padding: 4px 0;
}

.unit-tree-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    user-select: none;
}

.unit-tree-label:hover {
    background-color: #f1f5f9;
}

.unit-tree-label .form-check-input {
    margin-top: 0;
    cursor: pointer;
    width: 1.1rem;
    height: 1.1rem;
}

.unit-tree-label .unit-name {
    margin-left: 10px;
    font-size: 0.9rem;
    color: var(--dark);
}

.unit-tree-label .unit-icon {
    margin-left: 6px;
    font-size: 0.85rem;
    color: var(--secondary);
}

/* Recursive Indentation */
.unit-tree .unit-tree-children {
    list-style: none;
    padding-left: 24px;
    border-left: 1px dashed #cbd5e1;
    margin-left: 10px;
}

.unit-tree-toggle {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-radius: 4px;
}

.unit-tree-toggle:hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--primary);
}

.unit-tree-item.collapsed .unit-tree-toggle {
    transform: rotate(-90deg);
}

.unit-tree-item .unit-tree-children {
    transition: all 0.3s ease;
}

.has-children > .unit-tree-label .unit-name {
    font-weight: 600;
}
