/* Global Light Corporate Theme variables */
:root {
    --bg-main: #f4f6fb;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-sidebar-hover: #eef2ff;
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --danger-red: #dc2626;
    --success-green: #059669;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* Layout Styling */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 1px 0 3px rgba(15, 23, 42, 0.04);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-item {
    margin: 4px 16px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link i {
    font-size: 1.2rem;
}

.sidebar-link:hover {
    background-color: var(--bg-sidebar-hover);
    color: var(--accent-blue);
}

.sidebar-item.active .sidebar-link {
    background-color: var(--accent-blue);
    color: white;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    padding: 8px;
}

/* Content Area */
.content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-navbar {
    height: 70px;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 24px;
}

.main-content {
    padding: 32px;
    flex-grow: 1;
    overflow-y: auto;
}

/* Cards & Statistics */
.dashboard-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border-color: var(--accent-blue);
}

.card-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.bg-accent-light {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--accent-blue);
}

.bg-success-light {
    background-color: rgba(5, 150, 105, 0.1);
    color: var(--success-green);
}

.bg-danger-light {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--danger-red);
}

/* Cards & modals (bootstrap overrides for the theme) */
.card.bg-card,
.bg-card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.card.bg-card {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    border-radius: 12px;
}

.modal-content.bg-card {
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}

/* Tables Custom Styles */
.table-custom-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.table-custom {
    margin-bottom: 0;
    color: var(--text-primary);
}

.table-custom th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
}

.table-custom td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table-custom tbody tr {
    transition: background-color 0.2s ease;
}

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

/* Buttons */
.btn-primary {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--accent-blue-hover);
    border-color: var(--accent-blue-hover);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
}

.btn-outline-secondary:hover {
    background-color: var(--bg-sidebar-hover);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Inputs & Form Controls */
.form-control, .form-select {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff;
    border-color: var(--accent-blue);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control::placeholder {
    color: #94a3b8;
}

.input-group-text {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Login Page Layout */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #eef2ff, #f4f6fb 60%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* Badges */
.badge-client {
    background-color: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.25);
    padding: 6px 12px;
    border-radius: 30px;
    font-weight: 500;
}

.badge-company {
    background-color: rgba(5, 150, 105, 0.1);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, 0.25);
    padding: 6px 12px;
    border-radius: 30px;
    font-weight: 500;
}

/* Toast Container & Toasts */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
}

.toast-custom {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

/* Clipboard indicator animation */
.copied-flash {
    animation: flash 0.8s ease;
}

@keyframes flash {
    0% { background-color: rgba(37, 99, 235, 0.15); }
    100% { background-color: transparent; }
}

/* Responsive sidebars */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .sidebar-menu {
        flex-direction: row;
        display: flex;
        flex-wrap: wrap;
        padding: 8px;
    }
    .sidebar-item {
        margin: 2px 4px;
        flex-grow: 1;
    }
    .sidebar-link {
        padding: 8px 12px;
        justify-content: center;
    }
    .sidebar-footer {
        display: none;
    }
    .main-content {
        padding: 16px;
    }
}
