/* InfyJob HRMS — Zoho-inspired design tokens (visual only) */
:root {
    --primary: #1e88e5;
    --primary-dark: #1976d2;
    --primary-light: #e3f2fd;
    --accent: #1e88e5;
    --sidebar: #0f2744;
    --sidebar-hover: #1e88e5;
    --bg: #f5f7fa;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #2e7d32;
    --danger: #d32f2f;
    --warning: #ed6c02;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    padding: 2rem;
}

.auth-card {
    background: rgba(255,255,255,.97);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 .25rem;
}

.auth-brand p {
    color: var(--text-muted);
    margin: 0;
    font-size: .9rem;
}

/* App layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar);
    color: #cbd5e1;
    padding: 1.5rem 1rem;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: .5rem 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 1rem;
    text-align: center;
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.sidebar-powered-by {
    font-size: .58rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .55);
    line-height: 1.2;
    letter-spacing: .02em;
}

.sidebar-powered-by strong {
    color: rgba(255, 255, 255, .82);
    font-weight: 700;
}

.sidebar-brand-logo {
    width: var(--sidebar-logo-width, 88px);
    max-width: min(100%, var(--sidebar-logo-width, 88px));
    height: auto;
    max-height: none;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.sidebar-logo {
    height: 40px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: .75rem;
    display: block;
}

.sidebar-brand-text {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: .35rem;
    margin-bottom: .5rem;
}

.sidebar-company {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.sidebar-product {
    font-size: 1.1rem;
    font-weight: 700;
    color: #93c5fd;
}

.sidebar-brand span { color: #818cf8; }

.sidebar nav a,
.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: .9rem;
    transition: all .2s;
}

.sidebar .nav-icon {
    flex-shrink: 0;
    width: 1.15rem;
    font-size: 1.05rem;
    text-align: center;
}

.sidebar .nav-label {
    width: auto;
    flex: 1;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(30, 64, 175, .35);
    color: #fff;
    border-left: 3px solid #3b82f6;
    padding-left: calc(1rem - 3px);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 4px;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: .85rem 1rem;
    color: #fca5a5 !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.25);
    transition: all .2s;
}

.sidebar-logout-btn:hover {
    background: rgba(239,68,68,.25);
    color: #fff !important;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.header-right-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .55rem;
    margin-left: auto;
    flex-shrink: 0;
}

.portal-search-form {
    min-width: 180px;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    box-shadow: var(--shadow);
}

.theme-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.theme-toggle-btn i {
    font-size: 1rem;
    line-height: 1;
}

.logout-header-btn {
    background: #fee2e2;
    color: #991b1b;
    padding: .5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    border: 1px solid #fecaca;
    transition: all .2s;
}

.logout-header-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 1.5rem 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.user-badge {
    background: var(--card);
    padding: .5rem 1rem;
    border-radius: 99px;
    font-size: .875rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* Cards */
.card-panel {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.card-panel h3 {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stat-box .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-box .label {
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: .25rem;
}

/* Forms */
.form-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    margin-bottom: .35rem;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: .6rem .85rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    padding: .6rem 1.25rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}


/* Tables */
.table-panel { overflow-x: auto; }

.table {
    margin: 0;
    font-size: .875rem;
}

.table thead th {
    background: #f8fafc;
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    padding: .85rem 1rem;
}

.table tbody td {
    padding: .85rem 1rem;
    vertical-align: middle;
}

/* Badges */
.badge-status {
    padding: .3rem .65rem;
    border-radius: 99px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-active, .badge-present, .badge-completed, .badge-resolved { background: #d1fae5; color: #065f46; }
.badge-inactive, .badge-absent, .badge-pending, .badge-open { background: #fee2e2; color: #991b1b; }
.badge-in_progress { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Clock widget */
.clock-widget {
    text-align: center;
    padding: 2rem;
}

.clock-time {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.clock-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.clock-actions .btn { flex: 1; padding: .85rem; font-weight: 600; }

/* Profile grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.info-item .label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.info-item .value {
    font-size: .95rem;
    font-weight: 600;
    margin-top: .25rem;
}

/* Payslip */
.payslip-doc {
    border: 2px solid #334155;
    padding: 2rem;
    max-width: 700px;
    margin: 0 auto;
}

.payslip-doc .brand {
    text-align: center;
    border-bottom: 2px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

/* Panel badges */
.panel-type-badge {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid;
    border-radius: 4px;
    padding: 2px 8px;
    margin-top: 8px;
    display: inline-block;
    margin-left: auto;
    margin-right: auto;
}

.header-panel-tag {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 3px 10px;
    border-radius: 99px;
    display: inline-block;
    margin-bottom: 4px;
}

.admin-tag { background: #fef3c7; color: #92400e; }
.vendor-tag { background: #dbeafe; color: #1e40af; }
.employee-tag { background: #d1fae5; color: #065f46; }
.admin-badge { border-left: 3px solid #fbbf24; }
.employee-badge { border-left: 3px solid #34d399; }

.page-header h2 { margin: 0; font-size: 1.5rem; }

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }

.kpi-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
}

.kpi-primary { border-left-color: #1e40af; }
.kpi-success { border-left-color: #059669; }
.kpi-danger  { border-left-color: #dc2626; }
.kpi-warning { border-left-color: #d97706; }
.kpi-info    { border-left-color: #0284c7; }
.kpi-purple  { border-left-color: #7c3aed; }

.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: var(--text); }
.kpi-label { font-size: .78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-top: .15rem; }

/* HR Progress */
.hr-progress {
    height: 8px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}

.hr-progress-bar {
    height: 100%;
    border-radius: 99px;
    transition: width .5s ease;
}

/* Attendance ring */
.attendance-ring {
    text-align: center;
    padding: 1rem 0;
}

.ring-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--success);
}

.ring-label { font-size: .85rem; color: var(--text-muted); }

/* Task pipeline */
.task-pipeline { display: flex; flex-direction: column; gap: .75rem; }

.pipeline-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    background: #f8fafc;
    border-radius: 8px;
}

.pipeline-item strong { margin-left: auto; }
.pipeline-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pipeline-dot.pending  { background: #ef4444; }
.pipeline-dot.progress { background: #f59e0b; }
.pipeline-dot.done     { background: #10b981; }

.desig-bar-row { margin-bottom: .75rem; }

/* Recent items */
.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}

.recent-item:last-child { border-bottom: none; }

/* Quick actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
}

.quick-action-btn {
    display: block;
    padding: .75rem 1rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    text-align: center;
    transition: all .2s;
    border: 1px solid #c7d2fe;
}

.quick-action-btn:hover {
    background: var(--primary);
    color: white;
}

/* Welcome banner (employee) */
.welcome-banner {
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow);
}

.welcome-banner h3 { margin: 0 0 .25rem; font-size: 1.25rem; font-weight: 700; }
.welcome-banner p  { margin: 0; color: var(--text-muted); font-size: .9rem; }

.status-pill {
    padding: .4rem 1rem;
    border-radius: 99px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.status-pill.present { background: #d1fae5; color: #065f46; }
.status-pill.absent  { background: #fee2e2; color: #991b1b; }

/* Data Center */
.data-center-tabs {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.data-tab {
    padding: .6rem 1.1rem;
    border-radius: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    font-size: .85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
    transition: all .2s;
}

.data-tab:hover, .data-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tab-count {
    background: rgba(0,0,0,.1);
    padding: 1px 7px;
    border-radius: 99px;
    font-size: .75rem;
}

.data-tab.active .tab-count { background: rgba(255,255,255,.25); }

.record-count-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: .3rem .75rem;
    border-radius: 99px;
    font-size: .8rem;
    font-weight: 600;
}

.db-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.db-summary-item {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.db-summary-item span {
    display: block;
    font-size: .7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: .25rem;
}

.db-summary-item strong { font-size: 1.25rem; color: var(--primary); }

.data-table { font-size: .82rem; }
.data-table td { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Password show/hide */
.password-field-wrap {
    position: relative;
}

.password-field-wrap .password-input {
    padding-right: 3rem;
}

.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.55;
    padding: 4px 6px;
    line-height: 1;
    transition: opacity .2s;
}

.password-toggle-btn:hover { opacity: 1; }

/* Profile page */
.profile-header-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.profile-header-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 0;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-header-details h3 {
    margin: 0 0 .25rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.profile-role {
    margin: 0 0 .75rem;
    color: var(--text-muted);
    font-size: .92rem;
}

.profile-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
}

.profile-meta-item {
    font-size: .85rem;
    color: var(--text-muted);
}

.profile-meta-item strong {
    color: var(--text);
    font-weight: 600;
}

.profile-header-status {
    flex-shrink: 0;
}

.profile-tabs {
    display: flex;
    gap: .25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.profile-tab {
    background: none;
    border: none;
    padding: .8rem 1.35rem;
    font-weight: 600;
    font-size: .88rem;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all .2s;
    letter-spacing: .01em;
}

.profile-tab:hover { color: var(--primary); }
.profile-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--primary-light);
    border-radius: 8px 8px 0 0;
}

.profile-section {
    height: 100%;
}

.profile-section-head {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.profile-section-head h3 {
    margin: 0 0 .25rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.profile-section-sub {
    font-size: .82rem;
    color: var(--text-muted);
}

.profile-detail-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.profile-detail-list-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0 1.5rem;
}

.profile-detail-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.profile-detail-row:last-child {
    border-bottom: none;
}

.profile-detail-row dt {
    margin: 0;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}

.profile-detail-row dd {
    margin: 0;
    font-size: .92rem;
    font-weight: 500;
    color: var(--text);
    word-break: break-word;
}

.profile-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.profile-form-section {
    margin-bottom: 1.75rem;
}

.profile-form-section h4 {
    font-size: .88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin: 0 0 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

.profile-form-actions {
    display: flex;
    gap: .75rem;
    padding-top: .5rem;
}

.profile-security-form {
    max-width: 480px;
}

.profile-edit-panel {
    max-width: 920px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.profile-asset-card {
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.profile-asset-card-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: #eff6ff;
    color: #1e40af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.profile-asset-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

.profile-asset-quick li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .45rem 0;
    border-bottom: 1px solid var(--border);
}

.profile-asset-quick li:last-child { border-bottom: 0; }

.profile-asset-badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.profile-asset-badge-lg {
    font-size: .78rem;
    padding: .35rem .75rem;
}

.profile-asset-assigned,
.profile-asset-issued {
    background: #dcfce7;
    color: #166534;
}

.profile-asset-unassigned {
    background: #f1f5f9;
    color: #64748b;
}

.profile-asset-returned {
    background: #e0e7ff;
    color: #3730a3;
}

.profile-asset-repair,
.profile-asset-damaged {
    background: #fef3c7;
    color: #92400e;
}

.profile-asset-applied,
.profile-asset-pending-verification {
    background: #dbeafe;
    color: #1e40af;
}

.profile-asset-lost {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 768px) {
    .profile-header-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-detail-row {
        grid-template-columns: 1fr;
        gap: .25rem;
    }
}

.auth-tabs .nav-link { font-weight: 600; }

/* Announcements */
.announcement-feed { display: flex; flex-direction: column; gap: .75rem; }

.announcement-item {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    background: #f8fafc;
}

.announcement-item.priority-important { border-left-color: #f59e0b; background: #fffbeb; }
.announcement-item.priority-urgent { border-left-color: #dc2626; background: #fef2f2; }

/* Reports */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.report-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}

.report-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.report-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.report-card h4 { font-size: 1rem; margin-bottom: .5rem; }
.report-card p { font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; }

/* Filter pills */
.filter-pills { display: flex; gap: .5rem; flex-wrap: wrap; }

.filter-pill {
    padding: .4rem 1rem;
    border-radius: 99px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 600;
    transition: all .2s;
}

.filter-pill:hover, .filter-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Notifications */
.notification-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .5rem .85rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}

.notification-btn .bi-bell {
    font-size: 1rem;
}

.notification-btn-label {
    font-size: .82rem;
}

.notification-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-menu {
    width: 340px;
    padding: 0;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.notification-menu-body {
    max-height: 280px;
    overflow-y: auto;
}

.notification-menu-foot {
    border-top: 1px solid var(--border);
    padding: .35rem 0;
    background: var(--bg-subtle, #f8fafc);
}

.notification-account-link {
    display: flex !important;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    font-size: .85rem;
}


.notification-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.notification-btn .bi-bell {
    font-size: 1rem;
}

.notification-btn-label {
    font-size: .82rem;
}

.sidebar-account {
    padding: .5rem .65rem .25rem;
    border-top: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.sidebar-account-link {
    opacity: .95;
    font-size: .88rem;
}

.sidebar-account-link.active {
    background: rgba(255,255,255,.14);
}

.notification-menu-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.notification-item {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .75rem 1rem !important;
    border-bottom: 1px solid #f1f5f9;
    white-space: normal;
}

.notification-item.unread { background: #eff6ff; }
.notification-item span { font-size: .82rem; color: var(--text-muted); }
.notification-item small { font-size: .72rem; color: #94a3b8; }
.notification-view-all { font-weight: 600; color: var(--primary) !important; }

.notification-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.notification-row.unread { background: #f8fafc; margin: 0 -1rem; padding: 1rem; border-radius: 8px; }

/* HR Calendar */
.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.calendar-legend { display: flex; gap: 1rem; flex-wrap: wrap; }
.legend-item { font-size: .78rem; font-weight: 600; padding: .25rem .65rem; border-radius: 4px; }
.legend-item.leave-approved { background: #d1fae5; color: #065f46; }
.legend-item.leave-pending { background: #fef3c7; color: #92400e; }
.legend-item.holiday { background: #dbeafe; color: #1e40af; }

.hr-calendar { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.calendar-weekdays, .calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-weekdays span {
    background: #f8fafc;
    padding: .6rem;
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.calendar-day {
    min-height: 90px;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    padding: .35rem;
    background: #fff;
}

.calendar-day.empty { background: #f8fafc; }
.day-num { font-size: .78rem; font-weight: 700; color: var(--text-muted); margin-bottom: .25rem; }

.calendar-event {
    font-size: .65rem;
    font-weight: 600;
    padding: .15rem .35rem;
    border-radius: 3px;
    margin-bottom: 2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event.leave.approved { background: #d1fae5; color: #065f46; }
.calendar-event.leave.pending { background: #fef3c7; color: #92400e; }
.calendar-event.holiday { background: #dbeafe; color: #1e40af; }

/* Employee Directory */
.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.directory-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.directory-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.directory-card h4 { margin: 0 0 .15rem; font-size: 1rem; }
.directory-role { margin: 0 0 .75rem; font-size: .85rem; color: var(--text-muted); }

.directory-meta { margin: 0; }
.directory-meta div { margin-bottom: .35rem; }
.directory-meta dt { font-size: .68rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.directory-meta dd { margin: 0; font-size: .85rem; font-weight: 500; }

.policy-row { padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.policy-row:last-child { border-bottom: none; padding-bottom: 0; }

.attendance-policy-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #d97706;
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.attendance-policy-banner h3 {
    margin: 0 0 .75rem;
    font-size: 1rem;
    font-weight: 700;
    color: #92400e;
}

.attendance-policy-banner ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #78350f;
    font-size: .88rem;
}

.attendance-policy-banner li { margin-bottom: .35rem; }

.attendance-form-embed {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #f8fafc;
}

.attendance-form-embed iframe {
    display: block;
    border: none;
}

.attendance-today-status p { margin-bottom: .5rem; font-size: .9rem; }

.attendance-form-tabs .nav-link {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-muted);
}

.attendance-form-tabs .nav-link.active {
    color: var(--primary);
}

/* Admin monthly attendance */
.attendance-admin-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.attendance-month-form {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
}

.attendance-month-form label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: .25rem;
}

.attendance-month-form input[type="month"] {
    min-width: 180px;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.attendance-toolbar-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.attendance-legend {
    display: flex;
    gap: .85rem;
    flex-wrap: wrap;
    font-size: .75rem;
    color: var(--text-muted);
}

.attendance-legend span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.attendance-matrix-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 70vh;
}

.attendance-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
    min-width: 900px;
}

.attendance-matrix th,
.attendance-matrix td {
    border: 1px solid var(--border);
    padding: .45rem .35rem;
    text-align: center;
    vertical-align: middle;
    background: #fff;
}

.attendance-matrix thead th {
    background: #f8fafc;
    font-weight: 700;
    color: var(--text, #334155);
    position: sticky;
    top: 0;
    z-index: 2;
}

.att-sticky-col {
    position: sticky;
    left: 0;
    z-index: 3;
    text-align: left !important;
    min-width: 180px;
    background: #fff !important;
    box-shadow: 2px 0 4px rgba(0,0,0,.04);
}

.attendance-matrix thead .att-sticky-col {
    z-index: 4;
    background: #f8fafc !important;
}

.att-sticky-col strong {
    display: block;
    font-size: .82rem;
}

.att-sticky-col small {
    color: var(--text-muted);
    font-size: .7rem;
}

.att-summary-col {
    min-width: 52px;
    background: #f8fafc !important;
    font-weight: 600;
}

.att-day-col {
    min-width: 34px;
    padding: .25rem !important;
}

.att-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: .68rem;
    font-weight: 700;
    font-style: normal;
}

.att-present { background: #dcfce7; color: #166534; }
.att-late { background: #fef3c7; color: #b45309; }
.att-early { background: #fee2e2; color: #b91c1c; }
.att-weekend { background: #f1f5f9; color: #94a3b8; }
.att-absent { background: #fff; color: #cbd5e1; border: 1px dashed #e2e8f0; }

/* Employee attendance calendar with present ticks */
.emp-att-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  font-size: .8rem;
  color: var(--text-muted, #64748b);
}
.emp-att-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 6px;
  margin-right: .35rem;
  font-weight: 700;
  font-style: normal;
}
.emp-att-mark.present { background: #dcfce7; color: #166534; }
.emp-att-mark.late { background: #fef3c7; color: #b45309; }
.emp-att-mark.early { background: #fee2e2; color: #b91c1c; }
.emp-att-mark.weekend { background: #f1f5f9; }
.emp-att-mark.absent { background: #fff; border: 1px dashed #e2e8f0; }
.emp-att-cal-head,
.emp-att-cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .4rem;
}
.emp-att-cal-head {
  margin-bottom: .45rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted, #64748b);
  text-align: center;
}
.emp-att-cal-week { margin-bottom: .4rem; }
.emp-att-cal-day {
  min-height: 4.25rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: .45rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
}
.emp-att-cal-day.is-empty { border: none; background: transparent; }
.emp-att-cal-day.is-today { box-shadow: inset 0 0 0 2px #2563eb; }
.emp-att-cal-day.tone-present { background: #f0fdf4; border-color: #bbf7d0; }
.emp-att-cal-day.tone-late { background: #fffbeb; border-color: #fde68a; }
.emp-att-cal-day.tone-early { background: #fef2f2; border-color: #fecaca; }
.emp-att-cal-day.tone-weekend { background: #f8fafc; color: #94a3b8; }
.emp-att-cal-day.tone-absent { background: #fff; }
.emp-att-daynum { font-size: .85rem; font-weight: 600; color: #334155; }
.emp-att-tick {
  align-self: flex-end;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  color: #16a34a;
}
.emp-att-cal-day.tone-late .emp-att-tick { color: #d97706; }
.emp-att-cal-day.tone-early .emp-att-tick { color: #dc2626; }
.emp-att-cal-day.is-present .emp-att-daynum { color: #166534; }

/* Resource Center */
.resource-intro {
    margin-bottom: 1.5rem;
}

.resource-intro h3 {
    margin-bottom: .35rem;
    font-size: 1.05rem;
}

.resource-category {
    margin-bottom: 1.75rem;
}

.resource-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .85rem;
}

.resource-category-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.resource-count {
    font-size: .75rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: .2rem .55rem;
    border-radius: 999px;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.resource-link-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    min-height: 100%;
}

.resource-link-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    transform: translateY(-2px);
    color: inherit;
}

.resource-link-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: .35rem;
}

.resource-type-badge {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
    padding: .15rem .45rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
}

.resource-link-card.type-portal .resource-type-badge {
    background: #f0fdf4;
    color: #15803d;
}

.resource-link-card.type-info .resource-type-badge {
    background: #fff7ed;
    color: #c2410c;
}

.resource-link-card.type-policy .resource-type-badge {
    background: #f5f3ff;
    color: #6d28d9;
}

/* Company policies — clickable card grid */
.policy-page-intro {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border-color: #e0e7ff;
}

.policy-page-intro-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4f46e5;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.policy-page-intro-text h3 {
    margin: 0 0 .35rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.policy-page-intro-text p {
    font-size: .88rem;
    line-height: 1.5;
}

.policy-page-intro-count {
    margin-left: auto;
    flex-shrink: 0;
    font-size: .75rem;
    font-weight: 700;
    padding: .35rem .7rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #4338ca;
}

.policy-category-block {
    margin-bottom: 1.5rem;
}

.policy-category-header {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: .85rem;
}

.policy-category-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.policy-category-icon.group-1 {
    background: #ede9fe;
    color: #6d28d9;
}

.policy-category-icon.group-2 {
    background: #dbeafe;
    color: #1d4ed8;
}

.policy-category-icon.group-3 {
    background: #dcfce7;
    color: #15803d;
}

.policy-category-header h4 {
    margin: 0 0 .15rem;
    font-size: .95rem;
    font-weight: 700;
}

.policy-category-header p {
    font-size: .8rem;
    color: var(--text-muted);
}

.policy-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.policy-doc-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 1.1rem 1.15rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.policy-doc-card:hover {
    border-color: #818cf8;
    box-shadow: 0 10px 28px rgba(79, 70, 229, .12);
    transform: translateY(-2px);
    color: inherit;
}

.policy-doc-card:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.policy-doc-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.policy-doc-card-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .55rem;
    background: #eef2ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.policy-doc-card-badge {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .18rem .5rem;
    border-radius: 999px;
    background: #f5f3ff;
    color: #6d28d9;
}

.policy-doc-card-title {
    margin: 0 0 .4rem;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.35;
}

.policy-doc-card-desc {
    margin: 0 0 1rem;
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
}

.policy-doc-card-cta {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: auto;
    font-size: .8rem;
    font-weight: 700;
    color: #4f46e5;
}

.policy-doc-card:hover .policy-doc-card-cta {
    color: #3730a3;
}

.policy-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .65rem;
}

.policy-dashboard-card-link {
    display: block;
    padding: .7rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fafbfc;
    text-decoration: none;
    color: inherit;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.35;
    transition: border-color .15s, background .15s;
}

.policy-dashboard-card-link:hover {
    border-color: #a5b4fc;
    background: #fff;
    color: #4338ca;
}

.policy-dashboard-card-link i {
    display: block;
    margin-top: .35rem;
    font-size: .75rem;
    color: #6366f1;
}

@media (max-width: 767px) {
    .policy-page-intro {
        flex-wrap: wrap;
    }

    .policy-page-intro-count {
        margin-left: 0;
    }

    .policy-card-grid {
        grid-template-columns: 1fr;
    }
}

.resource-link-card h4 {
    margin: 0 0 .45rem;
    font-size: .95rem;
    font-weight: 700;
}

.resource-link-card p {
    margin: 0 0 .85rem;
    font-size: .82rem;
    color: var(--text-muted);
    flex: 1;
}

.resource-open-btn {
    display: inline-block;
    align-self: flex-start;
    font-size: .78rem;
    font-weight: 600;
    color: var(--primary);
    background: #eff6ff;
    padding: .35rem .75rem;
    border-radius: 6px;
}

.resource-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.resource-quick-link {
    display: block;
    padding: .55rem .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text);
    background: #f8fafc;
    transition: background .15s, border-color .15s;
}

.resource-quick-link:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: var(--primary);
}

/* Footer */
.app-footer {
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    font-size: .75rem;
    color: var(--text-muted);
}

.app-footer-group {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.app-footer-logo {
    height: auto;
    object-fit: contain;
}

.app-footer .powered-by {
    font-size: .72rem;
    color: var(--text-muted);
    letter-spacing: .01em;
}

.app-footer .powered-by strong {
    color: var(--text);
    font-weight: 700;
}

.portal-watermark-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: -.25rem 0 .85rem;
    min-height: 1.25rem;
}

/* Powered-by / branding media — logo only, no frame */
.portal-powered-corner {
    position: static;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    margin: 0;
    padding: 0;
    text-align: right;
    align-self: flex-end;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0;
    min-height: 0;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 5;
}

.portal-powered-corner .portal-watermark-inline,
.portal-watermark-bare {
    margin: 0;
    padding: 0;
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0;
}

.portal-watermark,
.portal-watermark-inline {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: none;
    color: rgba(100, 116, 139, .85);
    user-select: none;
    white-space: nowrap;
    line-height: 1;
}

.portal-powered-logo,
.portal-powered-media,
.portal-powered-video {
    display: inline-block !important;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
    visibility: visible !important;
    opacity: 1 !important;
}

.portal-powered-video {
    background: transparent;
    border: 0;
}

.portal-branding-fallback {
    font-weight: 700;
    letter-spacing: .02em;
}

.portal-watermark-inline {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    padding: 0;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0;
}

.portal-watermark-label {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .62rem;
}

.portal-watermark strong,
.portal-watermark-inline strong {
    color: #1e40af;
    font-weight: 700;
    letter-spacing: .1em;
}

.portal-watermark-with-logo {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

/* Size comes from Appearance width/height inline styles — do not cap at 42px */
.portal-powered-logo,
.portal-powered-media,
.portal-powered-video {
    display: inline-block !important;
    object-fit: contain;
    vertical-align: middle;
    visibility: visible !important;
}

.portal-powered-video {
    background: transparent;
    border: 0;
}

.portal-branding-fallback {
    font-weight: 700;
    letter-spacing: .02em;
}

.portal-watermark-preview {
    justify-content: flex-end;
    padding: .5rem 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

[data-theme="dark"] .portal-watermark,
[data-theme="dark"] .portal-watermark-inline {
    color: rgba(148, 163, 184, .85);
}

[data-theme="dark"] .portal-watermark-inline {
    background: rgba(30, 41, 59, .9);
    border-color: rgba(71, 85, 105, .5);
}

[data-theme="dark"] .portal-watermark strong,
[data-theme="dark"] .portal-watermark-inline strong {
    color: #93c5fd;
}

@media print {
    .sidebar, .page-header, .no-print, .portal-powered-corner { display: none !important; }
    .main-content { margin: 0; padding: 0; }
}

@media (max-width: 768px) {
    .sidebar { width: 70px; }
    .sidebar nav a span, .sidebar-brand span { display: none; }
    .main-content { margin-left: 70px; padding: 1rem; }
}

/* Master permissions UI */
.permission-tabs .nav-link {
    border-radius: 999px;
    padding: .5rem 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
}
.permission-tabs .nav-link.active {
    background: var(--primary);
    color: #fff;
}
.permission-group {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .85rem 1rem;
    margin-bottom: .85rem;
    background: #fafbfc;
}
.permission-group-head {
    margin-bottom: .65rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}
.permission-group-head strong { display: block; }
.permission-toggle-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem 0;
    border-bottom: 1px solid #eef2f7;
}
.permission-toggle-row:last-child { border-bottom: none; }
.permission-label { font-weight: 500; font-size: .88rem; }
.permission-key { font-size: .72rem; color: var(--text-muted); font-family: monospace; }
.permission-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.permission-switch input { opacity: 0; width: 0; height: 0; }
.permission-switch-ui {
    position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; cursor: pointer; transition: .2s;
}
.permission-switch-ui:before {
    content: ""; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%; transition: .2s;
}
.permission-switch input:checked + .permission-switch-ui { background: #22c55e; }
.team-avatar {
    width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
}
.permission-matrix-table th, .permission-matrix-table td { vertical-align: middle; }
.permission-matrix-table th { font-size: .72rem; white-space: nowrap; }

/* Unified Workspace (Zoom + SixthSense) */
.zoom-join-box {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .42rem .9rem;
    border-radius: 10px;
    background: #2563eb;
    color: #fff !important;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-decoration: none !important;
    border: 1px solid #1d4ed8;
    box-shadow: 0 1px 2px rgba(37, 99, 235, .25);
    transition: background .15s, transform .15s;
    white-space: nowrap;
}
.zoom-join-box:hover,
.zoom-join-box:focus {
    background: #1d4ed8;
    color: #fff !important;
    transform: translateY(-1px);
}
.zoom-join-box i { font-size: .95rem; }
.uw-dropdown { min-width: 12rem; }

.uw-card {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    background: linear-gradient(135deg, #eff6ff 0%, #fff 60%);
}
.uw-card-head {
    display: flex;
    align-items: center;
    gap: .9rem;
}
.uw-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}
.uw-card-head strong {
    display: block;
    font-size: 1.05rem;
    color: #1e3a8a;
}
.uw-card-head span {
    display: block;
    font-size: .82rem;
    color: #64748b;
}
.uw-simple-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
    max-width: 520px;
}
.uw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-width: 200px;
    padding: .85rem 1.35rem;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .12);
}
.uw-btn:hover { filter: brightness(0.95); color: #fff !important; }
.uw-btn-zoom { background: #2563eb; }
.uw-btn-ss { background: #059669; }
.uw-action {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1rem;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: .88rem;
    text-decoration: none !important;
    color: #fff !important;
    cursor: pointer;
}
.uw-action-zoom { background: #2563eb; }
.uw-action-zoom:hover { background: #1d4ed8; color: #fff !important; }
.uw-action-ss { background: #059669; }
.uw-action-ss:hover { background: #047857; color: #fff !important; }

.sidebar-nav-link-zoom {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    font-weight: 700;
}
.sidebar-nav-link-zoom .nav-icon { color: #2563eb !important; }
.sidebar-nav-link-zoom:hover {
    background: #dbeafe !important;
}

/* Dark theme */
[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --primary-light: #1e293b;
    --sidebar: #0b1220;
    --sidebar-hover: #1e293b;
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,.35), 0 4px 12px rgba(0,0,0,.25);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.45);
}

[data-theme="dark"] body {
    background: var(--bg);
    color: var(--text);
}

[data-theme="dark"] .card-panel,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .table-panel,
[data-theme="dark"] .stat-box {
    background: var(--card);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .page-header h2,
[data-theme="dark"] .kpi-value,
[data-theme="dark"] .card-panel h3,
[data-theme="dark"] .card-panel h5 {
    color: var(--text);
}

[data-theme="dark"] .text-muted,
[data-theme="dark"] .kpi-label,
[data-theme="dark"] .ring-label {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .main-content {
    background: var(--bg);
}

[data-theme="dark"] .user-badge,
[data-theme="dark"] .theme-toggle-btn {
    background: #111827;
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: #111827;
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .table {
    --bs-table-bg: var(--card);
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
}

[data-theme="dark"] .permission-group {
    background: #111827;
}

[data-theme="dark"] .pipeline-item,
[data-theme="dark"] .hr-progress {
    background: #111827;
}

[data-theme="dark"] .logout-header-btn {
    background: rgba(239, 68, 68, .15);
    border-color: rgba(239, 68, 68, .35);
    color: #fca5a5;
}

/* Enterprise modal header — close button alignment */
.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}
.modal-header .btn-close {
    flex-shrink: 0;
    margin: 0;
    padding: 0.5rem;
    align-self: center;
}
.modal-header .modal-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding-right: 0.5rem;
    word-break: break-word;
}
.modal-header > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 0.5rem;
}
