/* Layout - AdminLTE-inspired */
:root {
    --sidebar-width: 250px;
    --topbar-height: 3.5rem;
    --sidebar-bg: #343a40;
    --sidebar-text: rgba(255,255,255,.8);
    --sidebar-hover: rgba(255,255,255,.1);
}

.layout-body {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    transition: width 0.2s, margin 0.2s;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .sidebar-brand a span,
.sidebar.collapsed .sidebar-nav a span {
    display: none;
}

.sidebar-brand {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.sidebar-brand a i {
    font-size: 1.25rem;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
}

.sidebar-nav li a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav li a i {
    font-size: 1.1rem;
    width: 1.5rem;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,.1);
    margin: 0.5rem 1rem;
    list-style: none;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

.topbar-spacer {
    flex: 1;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-user .username {
    color: #6c757d;
    font-size: 0.9rem;
}

.main-content {
    flex: 1;
    padding: 1.5rem;
    background: #f8f9fa;
}

.card {
    border: none;
    box-shadow: 0 0 1px rgba(0,0,0,.1), 0 2px 4px rgba(0,0,0,.05);
}

th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th.sortable:hover {
    background: rgba(0,0,0,.04);
}

th.sortable .sort-icon {
    margin-left: 0.25rem;
    font-size: 0.75em;
    opacity: 0.6;
}

th.sortable.active .sort-icon {
    opacity: 1;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1030;
        transform: translateX(-100%);
        transition: transform 0.2s;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
}
