/* --- TOOPIS GLOBAL MODERN UI REDESIGN --- */

/* 1. Global Font & Variables */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --surface-color: #ffffff;
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    --box-shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --box-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --box-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition-speed: 0.35s;
    --bg-light: #f8fafc;
}

/* Animations Core */
@keyframes fadeUpIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

body {
    background-color: var(--bg-light) !important;
    color: #1e293b;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* Header Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
    z-index: 1040;
}

/* Sidebar Styling & Widen Options */
body:not(.hide-sidebar):not(.page-small) #wrapper {
    margin-left: 270px !important;
}

body.page-small.show-sidebar #wrapper {
    margin-left: 270px !important;
}

body.hide-sidebar:not(.show-sidebar) #menu,
body.page-small #menu {
    margin-left: -270px !important;
}

/* Sidebar Styling */
#setup-menu-wrapper,
.sidebar {
    width: 270px !important;
    background: #ffffff !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.03);
    border-right: 1px solid #e2e8f0;
}

.sidebar .nav>li>a {
    color: #475569 !important;
    border-radius: var(--border-radius-md);
    margin: 4px 16px;
    padding: 12px 14px;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
}

.sidebar .nav>li>a:hover,
.sidebar .nav>li.active>a {
    background: rgba(59, 130, 246, 0.05) !important;
    color: var(--primary-color) !important;
    transform: translateX(4px);
    box-shadow: inset 3px 0 0 var(--primary-color);
}

.sidebar .nav>li>a .menu-icon {
    color: #64748b;
    transition: color var(--transition-speed), transform var(--transition-speed);
}

.sidebar .nav>li>a:hover .menu-icon,
.sidebar .nav>li.active>a .menu-icon {
    color: #60a5fa !important;
    transform: scale(1.1);
}

/* Cards & Panels */
.panel_s {
    background: var(--surface-color) !important;
    border-radius: var(--border-radius-lg) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: var(--box-shadow-sm) !important;
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1), box-shadow var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin-bottom: 24px;
    animation: fadeUpIn 0.5s ease-out forwards;
}

.panel_s:hover {
    box-shadow: var(--box-shadow-md) !important;
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.panel_s .panel-body {
    border: none !important;
    padding: 28px;
}

/* Form Controls (Inputs, Selects, Textareas) */
.form-control {
    border-radius: var(--border-radius-sm) !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01) !important;
    padding: 10px 14px;
    height: auto !important;
    transition: all var(--transition-speed) ease;
    background-color: #f8fafc;
    color: #334155;
}

.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15) !important;
    background-color: var(--surface-color);
}

.bootstrap-select>.dropdown-toggle {
    border-radius: var(--border-radius-sm) !important;
    border: 1px solid #cbd5e1 !important;
    background-color: #f8fafc !important;
    transition: all var(--transition-speed);
}

.bootstrap-select>.dropdown-toggle:focus,
.bootstrap-select.show>.dropdown-toggle {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15) !important;
    background-color: var(--surface-color) !important;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius-sm) !important;
    border: none !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 10px 18px;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-info,
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3) !important;
}

.btn-info:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.4) !important;
    background: linear-gradient(135deg, var(--primary-hover), #7c3aed) !important;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669) !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3) !important;
    color: white !important;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.4) !important;
}

.btn-default {
    background-color: #f8fafc !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.btn-default:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
    transform: translateY(-1px);
}

/* Datatables */
table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0 12px !important;
    /* Spaced rows */
    margin-top: 10px !important;
    border: none !important;
}

table.dataTable>thead>tr>th {
    border-bottom: none !important;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    padding: 12px 14px;
    background: transparent;
}

table.dataTable>tbody>tr {
    background: var(--surface-color) !important;
    border-radius: var(--border-radius-md);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.01);
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1), box-shadow var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInRight 0.4s ease-out backwards;
}

/* Stagger animation for table rows */
table.dataTable>tbody>tr:nth-child(1) {
    animation-delay: 0.05s;
}

table.dataTable>tbody>tr:nth-child(2) {
    animation-delay: 0.1s;
}

table.dataTable>tbody>tr:nth-child(3) {
    animation-delay: 0.15s;
}

table.dataTable>tbody>tr:nth-child(4) {
    animation-delay: 0.2s;
}

table.dataTable>tbody>tr:nth-child(5) {
    animation-delay: 0.25s;
}

table.dataTable>tbody>tr>td {
    padding: 18px 14px;
    vertical-align: middle;
    border-top: 1px solid transparent !important;
    border-bottom: 1px solid transparent !important;
    color: #334155;
    font-size: 14px;
}

table.dataTable>tbody>tr>td:first-child {
    border-top-left-radius: var(--border-radius-md);
    border-bottom-left-radius: var(--border-radius-md);
}

table.dataTable>tbody>tr>td:last-child {
    border-top-right-radius: var(--border-radius-md);
    border-bottom-right-radius: var(--border-radius-md);
}

table.dataTable>tbody>tr:hover {
    transform: translateY(-2px) scale(1.005);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.03);
    z-index: 10;
    position: relative;
}

/* Pagination */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--border-radius-sm) !important;
    border: none !important;
    padding: 8px 14px !important;
    margin: 0 3px;
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    transform: translateY(-1px);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25) !important;
}

/* Modals with Glassmorphism */
.modal-backdrop.in {
    opacity: 0.6;
    background-color: #0f172a;
    backdrop-filter: blur(4px);
}

.modal-content {
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--box-shadow-lg);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
}

.modal-header {
    background: transparent;
    border-bottom: 1px solid #e2e8f0;
    padding: 24px 28px;
}

.modal-title {
    font-weight: 800;
    color: #0f172a;
    font-size: 20px;
    letter-spacing: -0.01em;
}

.modal-body {
    padding: 24px 28px;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 20px 28px;
    background: #f8fafc;
}

/* Tabs */
.nav-tabs {
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
    display: flex;
    gap: 8px;
}

.nav-tabs>li {
    margin-bottom: -1px;
}

.nav-tabs>li>a {
    color: #64748b;
    font-weight: 600;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    padding: 14px 20px;
    transition: all var(--transition-speed);
    font-size: 14px;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.nav-tabs>li>a:hover {
    background: #f1f5f9 !important;
    color: var(--primary-hover);
    border-bottom-color: #cbd5e1 !important;
}

.nav-tabs>li.active>a,
.nav-tabs>li.active>a:focus,
.nav-tabs>li.active>a:hover {
    color: var(--primary-color) !important;
    background: transparent !important;
    border-bottom-color: var(--primary-color) !important;
}

/* Scrollbars - macOS Style */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}