/* PERSOFT DESIGN SYSTEM VARIABLES */
:root {
    --primary: #2563eb;
    --primary-glow: #eff6ff;
    --primary-dark: #1d4ed8;
    --sidebar-bg: #0c1427;
    --sidebar-text: #94a3b8;
    --sidebar-hover: #1e293b;
    --success: #10b981;
    --success-glow: #ecfdf5;
    --warning: #f59e0b;
    --warning-glow: #fefbeb;
    --danger: #ef4444;
    --danger-glow: #fef2f2;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --card-border: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    --transition: all 0.2s ease-in-out;
    
    --radius-sm: 8px;
    --radius: 16px;
    --radius-lg: 20px;
}

/* GENERAL RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

/* APP LAYOUT */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR LEFT */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    background-color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
}

.sidebar-logo-title-group {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.sidebar-logo-title {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
    color: white;
}

.sidebar-logo-sub {
    font-size: 0.6rem;
    color: var(--sidebar-text);
    font-weight: 500;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-link i {
    width: 20px;
    font-size: 0.95rem;
    text-align: center;
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-link.active {
    background-color: var(--primary);
    color: #ffffff;
}

/* SIDEBAR PROFILE CARD BOTTOM */
.sidebar-profile {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(0, 0, 0, 0.2);
}

.sidebar-profile-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.03);
}

.sidebar-profile-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-profile-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.sidebar-profile-role {
    font-size: 0.7rem;
    color: var(--sidebar-text);
}

/* MAIN CONTENT BLOCK */
.main-wrapper {
    flex: 1;
    margin-left: 260px; /* offset for sidebar */
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* TOP HEADER BAR */
.topbar {
    height: 70px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.4rem;
    cursor: pointer;
}

.topbar-title h1 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.1;
}

.topbar-title span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.topbar-search {
    position: relative;
    width: 320px;
}

.topbar-search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--card-border);
    background-color: #f8fafc;
    border-radius: 100px;
    font-size: 0.85rem;
    transition: var(--transition);
}

.topbar-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #ffffff;
}

.topbar-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.topbar-search-shortcut {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    background-color: #ffffff;
    border: 1px solid var(--card-border);
    padding: 2px 6px;
    border-radius: 4px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.topbar-action-btn:hover {
    background-color: #f1f5f9;
    color: var(--text-color);
}

.topbar-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 1px solid var(--card-border);
    padding-left: 16px;
}

.topbar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.topbar-user-info {
    line-height: 1.2;
}

.topbar-user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
}

.topbar-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* CONTENT ZONE */
.main-content {
    padding: 32px;
}

/* CONTENT SECTIONS */
.content-section {
    background-color: var(--bg-card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
}

/* METRICS CARDS ROW (6 Cards) */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.metric-card-persoft {
    background-color: var(--bg-card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.metric-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.metric-card-icon.primary { background-color: var(--primary-glow); color: var(--primary); }
.metric-card-icon.success { background-color: var(--success-glow); color: var(--success); }
.metric-card-icon.warning { background-color: var(--warning-glow); color: var(--warning); }
.metric-card-icon.danger { background-color: var(--danger-glow); color: var(--danger); }

.metric-card-details {
    line-height: 1.2;
}

.metric-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.metric-card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 4px 0;
}

.metric-card-trend {
    font-size: 0.7rem;
    font-weight: 700;
}

.metric-card-trend.up { color: var(--success); }
.metric-card-trend.down { color: var(--danger); }

/* BADGES & CHIPS */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge.info { background-color: var(--primary-glow); color: var(--primary); }
.badge.success { background-color: var(--success-glow); color: var(--success); }
.badge.danger { background-color: var(--danger-glow); color: var(--danger); }

/* CUSTOM TABLES */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

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

.custom-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-color);
    background-color: var(--bg-card);
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.avatar-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary);
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-secondary {
    background-color: transparent;
    border-color: var(--card-border);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

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

.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
}

/* FORMS & INPUTS */
.search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-color);
    background-color: var(--bg-card);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-card {
    background-color: var(--bg-card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) auto;
    align-items: flex-end;
    gap: 16px;
}

.details-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.details-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.details-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.select-input, .date-input {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
    font-size: 0.85rem;
    background-color: var(--bg-card);
    color: var(--text-color);
}

/* PERSONNEL GRID */
.personnel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.personnel-card {
    background-color: var(--bg-card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
    border: 3px solid var(--primary-glow);
    background-color: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.75rem;
}

.card-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-color);
    margin-bottom: 4px;
}

.card-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 12px;
}

.card-badge {
    margin-bottom: 16px;
}

.card-actions {
    width: 100%;
}

/* VIEW TOGGLE */
.view-toggle {
    display: flex;
    background-color: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
}

.toggle-btn {
    border: none;
    background: none;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.toggle-btn.active {
    background-color: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* DIALOG MODALS */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.modal-backdrop.active .modal-window {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--card-border);
    background-color: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 24px;
}

.details-full {
    grid-column: span 2;
}

/* PAGINATION */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 24px;
    list-style: none;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background-color: var(--bg-card);
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
}

.page-link:hover {
    border-color: var(--primary);
    background-color: var(--primary-glow);
    color: var(--primary);
}

.page-link.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-link.disabled {
    opacity: 0.5;
    pointer-events: none;
    background-color: #f1f5f9;
}

/* QUICK DATE FILTERS */
.quick-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.quick-filter-btn {
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.quick-filter-btn:hover, .quick-filter-btn.active {
    background-color: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary);
}

/* PRINTABLE ID BADGE */
.badge-preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.id-badge {
    width: 280px;
    height: 440px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 24px;
    overflow: hidden;
}

.id-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
}

.badge-clip-slot {
    width: 50px;
    height: 12px;
    background-color: #e2e8f0;
    border-radius: 100px;
    margin-bottom: 20px;
    z-index: 2;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.badge-logo {
    font-size: 0.85rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
    margin-bottom: 20px;
}

.badge-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: var(--shadow);
    z-index: 2;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 16px;
    overflow: hidden;
}

.badge-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
}

.badge-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.badge-dept {
    background-color: var(--primary-glow);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: auto;
}

.badge-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px dashed #e2e8f0;
    padding-top: 12px;
    margin-top: 12px;
}

.badge-meta {
    text-align: left;
}

.badge-meta-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.badge-meta-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-color);
}

.badge-qr {
    width: 44px;
    height: 44px;
    opacity: 0.75;
}

/* DRAWER SYSTEM */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    max-width: 100%;
    height: 100vh;
    background-color: var(--bg-card);
    border-left: 1px solid var(--card-border);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08);
    z-index: 101;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.drawer-panel.active {
    transform: translateX(0);
}

.drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--card-border);
    background-color: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.drawer-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: var(--shadow);
    background-color: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    overflow: hidden;
}

.drawer-name-title h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2px;
}

.drawer-name-title span {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.drawer-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.drawer-tabs {
    display: flex;
    background-color: #f1f5f9;
    padding: 4px;
    border-bottom: 1px solid var(--card-border);
}

.drawer-tab-btn {
    flex: 1;
    border: none;
    background: none;
    padding: 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    border-radius: 8px;
    transition: var(--transition);
}

.drawer-tab-btn.active {
    background-color: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.drawer-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.drawer-tab-content {
    display: none;
}

.drawer-tab-content.active {
    display: block;
}

.select-employee-card {
    background-color: var(--bg-card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.select-employee-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.select-employee-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* SIDEBAR RESPONSIVE BACKDROP */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* ANALYTICS CHARTS & SAYAÇLAR (GAUGES) */
.analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background-color: var(--bg-card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.chart-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gauges-card-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px 0;
}

.gauge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.circular-progress {
    position: relative;
    width: 100px;
    height: 100px;
}

.circular-progress svg {
    width: 100px;
    height: 100px;
    transform: rotate(-90deg);
}

.circular-progress circle {
    width: 100%;
    height: 100%;
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.circular-progress .bg-circle {
    stroke: var(--primary-glow);
}

.circular-progress .fg-circle {
    stroke: var(--primary);
    stroke-dasharray: 283; /* 2 * PI * r (r=45) => 282.7 */
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease;
}

.circular-progress .progress-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-color);
}

.gauge-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.dashboard-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* RESPONSIVE LAYOUT (MEDIA QUERIES) */
@media (max-width: 1400px) {
    .metrics-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .topbar-toggle {
        display: block;
    }
    
    .topbar-search {
        display: none; /* Hide search bar on smaller tablets */
    }
    
    .analytics-grid, .dashboard-split-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .topbar-right {
        gap: 8px;
    }
    
    .topbar-user {
        border-left: none;
        padding-left: 0;
    }
    
    .topbar-user-info {
        display: none;
    }
    
    .main-content {
        padding: 20px 16px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }

    .details-full {
        grid-column: span 1;
    }

    .pagination {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .metrics-row {
        grid-template-columns: 1fr;
    }
}

/* PRINT STYLES */
@media print {
    body {
        background-color: white !important;
        color: black !important;
        font-size: 10pt;
    }

    .sidebar, .topbar, .sidebar-backdrop, .search-form, .filter-card, .btn, .pagination, .view-toggle {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
    }

    .main-content {
        padding: 0 !important;
        width: 100% !important;
    }

    .content-section {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .custom-table th {
        background-color: #f1f5f9 !important;
        color: black !important;
        border-bottom: 2px solid #cbd5e1 !important;
    }

    .custom-table td {
        border-bottom: 1px solid #e2e8f0 !important;
    }
}

/* PERSOFT DASHBOARD EXCLUSIVE COMPONENT LAYOUTS */
.dashboard-grid-persoft {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .dashboard-grid-persoft {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-grid-persoft {
        grid-template-columns: 1fr;
    }
}

/* PROGRESS LIST FOR DEPARTMENTS */
.progress-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
}

.progress-item-bar-bg {
    height: 8px;
    background-color: #f1f5f9;
    border-radius: 100px;
    overflow: hidden;
}

.progress-item-bar-fg {
    height: 100%;
    background-color: var(--primary);
    border-radius: 100px;
    transition: width 1s ease-in-out;
}

/* RECENT USER LIST ON DASHBOARD */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    list-style: none;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--card-border);
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.recent-item-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.recent-item-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-color);
}

.recent-item-title {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.recent-item-time-status {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.recent-item-time {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
}

/* CHIPS FOR TIME */
.chip {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-block;
}

.chip.success {
    background-color: var(--success-glow);
    color: var(--success);
}

.chip.warning {
    background-color: var(--warning-glow);
    color: var(--warning);
}

/* SIDEBAR SUBMENU SYSTEM */
.sidebar-menu-item {
    position: relative;
    width: 100%;
}

.sidebar-menu-item button.sidebar-link {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-menu-item button.sidebar-link span {
    flex: 1;
}

.submenu-arrow {
    font-size: 0.65rem;
    color: var(--sidebar-text);
    transition: transform 0.25s ease;
}

.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    list-style: none;
    padding-left: 36px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-submenu li a {
    display: block;
    padding: 4px 0;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.74rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-submenu li a:hover {
    color: #ffffff;
}

.sidebar-menu-item.open .sidebar-submenu {
    padding-bottom: 4px;
}
