/* --- VETGIM SAAS THEME --- */
:root {
    /* Your Custom Palette */
    --primary: #2b636b;
    --primary-dark: #11292c;
    --accent: #d2d5d3;
    
    /* SaaS Neutrals */
    --bg-app: #f4f7f6; /* Very light cool gray for the app background */
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 8px;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- LAYOUT: SIDEBAR & MAIN --- */
.sidebar {
    width: 260px;
    background-color: var(--primary-dark);
    color: white;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar-brand {
    padding: 24px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--surface);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    letter-spacing: 1px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;             /* Takes up remaining space */
    overflow-y: auto;    /* ADDS A SCROLLBAR IF THE MENU IS TOO TALL */
    overflow-x: hidden;
}

/* Optional: Make the scrollbar look invisible/clean on windows */
.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
}

.sidebar-menu li a:hover, .sidebar-menu li a.active {
    background-color: var(--primary); /* #2b636b */
    color: white;
    border-left: 4px solid white;
}

.app-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- TOP HEADER --- */
.topbar {
    height: 70px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin: 0;
}

/* --- MAIN CONTENT AREA --- */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* --- SAAS COMPONENTS --- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 24px;
    border: 1px solid var(--border);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-danger { color: var(--danger); background: none; border: none; font-weight: 600; cursor: pointer; }
.btn-text { color: var(--primary); background: none; border: none; font-weight: 600; cursor: pointer; }

/* Forms */
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--text-main);
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 99, 107, 0.1);
}

/* SaaS Tables */
.table-saas {
    width: 100%;
    border-collapse: collapse;
}

.table-saas th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.table-saas td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: middle;
}

.table-saas tr:hover td {
    background-color: #f8fafc;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }

/* --- SAAS SUBMENU STYLES --- */
.menu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    color: var(--accent);
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.menu-toggle:hover {
    background-color: var(--primary);
    color: white;
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: rgba(0,0,0,0.15); /* Slightly darker to show depth */
}

.submenu.active {
    max-height: 1000px; /* Expands the menu smoothly */
}

.submenu li a {
    padding: 10px 24px 10px 48px; /* Deep indentation for sub-items */
    font-size: 0.9rem;
    color: #a0aec0;
}

.submenu li a:hover, .submenu li a.active {
    background-color: transparent;
    color: white;
    border-left: 4px solid var(--accent);
}

.chevron {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.chevron.rotate {
    transform: rotate(180deg);
}