/* ISP ERP & CRM Premium CSS System v1.0 */
/* Mint/Green Accent, Responsive, Clean, Premium and Dark Mode Ready */

:root {
    --bs-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --primary-color: #0f5132;
    --primary-light: #d1e7dd;
    --primary-hover: #146c43;
    --accent-color: #198754;
    --accent-light: #20c997;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --sidebar-bg: #0f5132;
    --sidebar-text: #ffffff;
    --sidebar-active: #198754;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #2d2d2d;
    --sidebar-bg: #1a1a1a;
    --sidebar-text: #e0e0e0;
    --sidebar-active: #0f5132;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.5);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.7);
}

body {
    font-family: var(--bs-font-sans-serif);
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    overflow-x: hidden;
}

/* Glassmorphism Panel card */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
[data-theme="dark"] .glass-card {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Premium Layout Components */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1000;
    transition: var(--transition);
    border-right: 1px solid var(--border-color);
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    opacity: 0.85;
    padding: 10px 20px;
    border-radius: 8px;
    margin: 4px 12px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    opacity: 1;
    background-color: var(--sidebar-active);
    color: #fff;
    transform: translateX(4px);
}

.main-content {
    margin-left: 260px;
    min-height: 100vh;
    padding: 24px;
    transition: var(--transition);
}

/* Navbar */
.top-navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    transition: var(--transition);
}

/* Theme Switcher */
.theme-toggle-btn {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
}

/* Custom Table Styles */
.custom-table {
    background-color: var(--card-bg);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    width: 100%;
}
.custom-table th {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 12px;
    font-weight: 600;
    text-align: left;
}
.custom-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}
.custom-table tr:last-child td {
    border-bottom: none;
}
.custom-table tbody tr:hover {
    background-color: rgba(25, 135, 84, 0.05);
}

/* Responsive Table & Text Wrapping Overrides */
.table, .custom-table {
    word-wrap: break-word;
    word-break: normal;
}
.table-responsive {
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
}
.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(25, 135, 84, 0.2);
    border-radius: 3px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(25, 135, 84, 0.4);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}
.btn-success {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Notifications Box */
.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    padding: 3px 6px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    font-size: 10px;
}

/* Responsive Drawer for mobile */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    /* Mobile backdrop overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
        display: none;
        backdrop-filter: blur(2px);
    }
    .sidebar-overlay.active {
        display: block;
    }
}

/* Extra small screen padding optimization */
@media (max-width: 575.98px) {
    .main-content {
        padding: 10px;
    }
    .top-navbar {
        padding: 10px 15px;
        margin-bottom: 12px !important;
    }
    .card {
        padding: 12px !important;
    }
}

/* Print CSS formatting */
@media print {
    .sidebar, .top-navbar, .btn, .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    body {
        background-color: #fff !important;
        color: #000 !important;
    }
    .card, .glass-card {
        border: none !important;
        box-shadow: none !important;
    }
}
