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

:root {
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Status Colors */
    --status-active-bg: #ecfdf5;
    --status-active-text: #047857;
    --status-locked-bg: #fef2f2;
    --status-locked-text: #b91c1c;
    --status-pending-bg: #fffbeb;
    --status-pending-text: #b45309;
    --status-lost-bg: #fff7ed;
    --status-lost-text: #c2410c;
    --status-disable-bg: #f1f5f9;
    --status-disable-text: #475569;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* Custom Premium Navbar */
.navbar-custom {
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
}

.navbar-brand-custom {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: transform 0.2s;
}
.navbar-brand-custom:hover {
    transform: scale(1.02);
}

.nav-link-custom {
    color: var(--text-muted) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.nav-link-custom:hover, .nav-link-custom.active {
    color: var(--primary) !important;
    background-color: var(--primary-light);
}

/* User Info Box */
.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--background);
    border-radius: 9999px;
    border: 1px solid var(--border);
}

/* Buttons */
.btn-primary-custom {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.625rem 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}
.btn-primary-custom:hover {
    background-color: var(--primary-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary-custom {
    background-color: var(--surface);
    color: var(--text-main);
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease;
}
.btn-secondary-custom:hover {
    background-color: var(--background);
    border-color: var(--border-hover);
}

/* Main Container spacing */
.main-content {
    padding: 2.5rem 1.5rem;
    min-height: calc(100vh - 120px);
}

/* Cards & Layout */
.card-custom {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.card-custom:hover {
    box-shadow: var(--shadow-md);
}

/* Login Page Styling */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #e0e7ff 0%, #f8fafc 60%);
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tables & Columns sorting */
.table-responsive-custom {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.table-custom {
    width: 100%;
    margin-bottom: 0;
    vertical-align: middle;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom th {
    background-color: #f1f5f9;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.table-custom td {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--text-main);
}

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

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

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.status-active {
    background-color: var(--status-active-bg);
    color: var(--status-active-text);
}
.status-locked {
    background-color: var(--status-locked-bg);
    color: var(--status-locked-text);
}
.status-pending {
    background-color: var(--status-pending-bg);
    color: var(--status-pending-text);
}
.status-password-lost {
    background-color: var(--status-lost-bg);
    color: var(--status-lost-text);
}
.status-disable {
    background-color: var(--status-disable-bg);
    color: var(--status-disable-text);
}

/* Filter/Search Bar Grid */
.filter-bar {
    padding: 1.5rem;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

/* Tag style badges */
.tag-badge {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    margin-right: 0.25rem;
    display: inline-block;
}

/* Sortable column header link */
.sortable-link {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.sortable-link:hover {
    color: var(--primary);
}

/* Custom Modal styling for detail popups */
.modal-custom-dialog {
    max-width: 650px !important;
}

.modal-content-custom {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header-custom {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.75rem;
}

.modal-body-custom {
    padding: 1.75rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.modal-footer-custom {
    background-color: #f8fafc;
    border-top: 1px solid var(--border);
    padding: 1rem 1.75rem;
}

/* Password eye-toggle button wrapper */
.password-input-wrapper {
    position: relative;
}
.password-input-wrapper input {
    padding-right: 2.75rem;
}
.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.15s;
}
.password-toggle-btn:hover {
    color: var(--primary);
}

/* Clipboard Copy Button */
.btn-copy {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 4px;
    transition: all 0.15s;
}
.btn-copy:hover {
    color: var(--primary);
    background-color: var(--background);
}

/* Custom Tooltip Toast style alerts */
.toast-custom {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #1e293b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-custom.show {
    transform: translateY(0);
    opacity: 1;
}

/* Mobile Responsive Adjustments */
@media(max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar > * {
        width: 100%;
    }
    .main-content {
        padding: 1.5rem 0.75rem;
    }
    .table-custom th, .table-custom td {
        padding: 0.75rem;
    }
}
