/* Zoho Books Inspired Premium SaaS Styling */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --zo-primary: #0073e6;
    --zo-primary-hover: #005bb5;
    --zo-sidebar-bg: #1c2434;
    --zo-sidebar-text: #8a99af;
    --zo-sidebar-active: #ffffff;
    --zo-sidebar-active-bg: #333a48;
    --zo-bg-light: #f3f4f6;
    --zo-text-dark: #1d2b36;
    --zo-text-muted: #6b7280;
    --zo-border: #e5e7eb;
    --zo-card-bg: #ffffff;
    --zo-success: #10b981;
    --zo-warning: #f59e0b;
    --zo-danger: #ef4444;
    --zo-info: #3b82f6;
    --sidebar-width: 260px;
    --header-height: 64px;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--zo-bg-light);
    color: var(--zo-text-dark);
    margin: 0;
    overflow-x: hidden;
    padding-bottom: 0;
}

/* ---------------- Layout ---------------- */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--zo-sidebar-bg);
    color: var(--zo-sidebar-text);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    background-color: rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.sidebar-nav-item {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    color: var(--zo-sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}

.sidebar-nav-item:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.05);
}

.sidebar-nav-item.active {
    color: var(--zo-sidebar-active);
    background-color: var(--zo-sidebar-active-bg);
    border-left-color: var(--zo-primary);
}

.sidebar-nav-item i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Important for preventing flex children from overflowing */
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background-color: var(--zo-card-bg);
    border-bottom: 1px solid var(--zo-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.header-search {
    width: 300px;
}

.header-search input {
    background-color: var(--zo-bg-light);
    border: 1px solid transparent;
    border-radius: 4px;
    padding-left: 36px;
    font-size: 0.9rem;
}

.header-search input:focus {
    background-color: #fff;
    border-color: var(--zo-primary);
    box-shadow: 0 0 0 2px rgba(0, 115, 230, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* ---------------- Components ---------------- */

/* Cards */
.card {
    background: var(--zo-card-bg);
    border: 1px solid var(--zo-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    margin-bottom: 24px;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--zo-border);
    padding: 16px 20px;
    font-weight: 500;
    color: var(--zo-text-dark);
}

.card-body {
    padding: 20px;
}

/* Tables */
.table {
    margin-bottom: 0;
    color: var(--zo-text-dark);
}

.table th {
    background-color: var(--zo-bg-light);
    color: var(--zo-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--zo-border);
    border-top: none;
}

.table td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--zo-border);
    font-size: 0.9rem;
}

.table tbody tr:hover {
    background-color: rgba(0,0,0,0.02);
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--zo-primary);
    border-color: var(--zo-primary);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--zo-primary-hover);
    border-color: var(--zo-primary-hover);
    box-shadow: 0 2px 4px rgba(0, 115, 230, 0.2);
}

.btn-outline-primary {
    color: var(--zo-primary);
    border-color: var(--zo-primary);
}

.btn-outline-primary:hover {
    background-color: var(--zo-primary);
    color: #fff;
}

/* Badges */
.badge {
    padding: 5px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Typography Overrides */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    color: var(--zo-text-dark);
}

h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }

a { color: var(--zo-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Utilities */
.text-muted { color: var(--zo-text-muted) !important; }

/* Responsive Sidebar Mobile Toggle (Simplistic approach) */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -var(--sidebar-width);
        height: 100vh;
    }
    .sidebar.show {
        left: 0;
    }
}
