/**
 * Attendance & Leave Portal - Ultra Smooth, Modern & Elegant CSS
 */

:root {
	--ap-primary: #6366f1;
	--ap-primary-hover: #4f46e5;
	--ap-success: #10b981;
	--ap-warning: #f59e0b;
	--ap-danger: #f43f5e;
	--ap-info: #06b6d4;
	--ap-purple: #8b5cf6;
	--ap-bg: #0f172a;
	--ap-card-bg: #1e293b;
	--ap-card-border: #334155;
	--ap-text-main: #f8fafc;
	--ap-text-muted: #94a3b8;
	--ap-border: #334155;
	--ap-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
	--ap-shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
	--ap-shadow-lg: 0 20px 30px -10px rgba(0, 0, 0, 0.5);
	--ap-radius: 16px;
}

/* Base Wrapper & Container */
.ap-portal-container {
	font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
	background: var(--ap-bg);
	border-radius: var(--ap-radius);
	box-shadow: var(--ap-shadow-lg);
	padding: 28px;
	color: var(--ap-text-main);
	max-width: 1040px;
	margin: 20px auto;
	box-sizing: border-box;
	border: 1px solid var(--ap-card-border);
}

/* Header Section */
.ap-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--ap-card-border);
	margin-bottom: 24px;
}

.ap-user-welcome {
	display: flex;
	align-items: center;
	gap: 16px;
}

.ap-avatar img {
	border-radius: 50%;
	border: 2px solid var(--ap-primary);
	box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.ap-user-info h3 {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--ap-text-main);
	letter-spacing: -0.02em;
}

.ap-user-role {
	font-size: 0.85rem;
	color: var(--ap-text-muted);
	text-transform: capitalize;
}

/* Navigation Segmented Tabs */
.ap-nav-tabs {
	display: flex;
	gap: 10px;
	background: #1e293b;
	padding: 6px;
	border-radius: 12px;
	border: 1px solid var(--ap-card-border);
	margin-bottom: 28px;
	overflow-x: auto;
}

.ap-tab-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 20px;
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--ap-text-muted);
	text-decoration: none;
	border-radius: 10px;
	transition: all 0.25s ease-in-out;
	white-space: nowrap;
}

.ap-tab-item:hover {
	color: var(--ap-text-main);
	background: rgba(255, 255, 255, 0.05);
}

.ap-tab-item.active {
	color: #ffffff;
	background: linear-gradient(135deg, var(--ap-primary) 0%, var(--ap-primary-hover) 100%);
	box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

/* Cards & Layout */
.ap-card {
	background: var(--ap-card-bg);
	border-radius: var(--ap-radius);
	padding: 28px;
	box-shadow: var(--ap-shadow-md);
	border: 1px solid var(--ap-card-border);
	margin-bottom: 24px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ap-card h3 {
	margin-top: 0;
	margin-bottom: 18px;
	font-size: 1.2rem;
	color: var(--ap-text-main);
}

/* Clock Display & IST Badge */
.ap-clock-card {
	text-align: center;
	background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e293b 100%);
	color: #ffffff;
	padding: 40px 24px;
	border: 1px solid #4338ca;
	position: relative;
	overflow: hidden;
}

.ap-tz-badge {
	display: inline-block;
	background: rgba(99, 102, 241, 0.25);
	border: 1px solid rgba(165, 180, 252, 0.3);
	color: #c7d2fe;
	padding: 4px 14px;
	border-radius: 9999px;
	font-size: 0.8rem;
	font-weight: 700;
	margin-bottom: 12px;
	letter-spacing: 0.5px;
}

.ap-live-clock {
	font-size: 3.2rem;
	font-weight: 800;
	letter-spacing: 2px;
	font-variant-numeric: tabular-nums;
	color: #38bdf8;
	text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
	margin-bottom: 6px;
}

.ap-live-date {
	font-size: 1.1rem;
	color: #94a3b8;
	margin-bottom: 12px;
}

.ap-work-timer-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: rgba(16, 185, 129, 0.15);
	border: 1px solid rgba(52, 211, 153, 0.3);
	color: #34d399;
	padding: 6px 18px;
	border-radius: 9999px;
	font-size: 0.95rem;
	font-weight: 700;
	margin-top: 6px;
	margin-bottom: 24px;
	box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}

.ap-timer-value {
	font-family: monospace, monospace;
	font-size: 1.05rem;
	letter-spacing: 1px;
	color: #6ee7b7;
}

.ap-timer-highlight {
	color: #34d399 !important;
	font-family: monospace, monospace;
	font-size: 1.25rem !important;
	letter-spacing: 0.5px;
}

/* Action Buttons */
.ap-action-buttons {
	display: flex;
	justify-content: center;
	gap: 18px;
	flex-wrap: wrap;
}

.ap-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 24px;
	font-size: 0.95rem;
	font-weight: 700;
	border-radius: 10px;
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ap-btn-lg {
	padding: 14px 32px;
	font-size: 1.05rem;
}

.ap-btn-primary {
	background: linear-gradient(135deg, var(--ap-primary) 0%, var(--ap-primary-hover) 100%);
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.ap-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.ap-btn-warning {
	background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.ap-btn-warning:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.ap-btn-success {
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	color: #ffffff;
}

.ap-btn-disabled {
	background: #334155;
	color: #94a3b8;
	cursor: not-allowed;
	border: 1px solid #475569;
}

.ap-btn-outline {
	background: transparent;
	border: 1px solid var(--ap-border);
	color: var(--ap-text-main);
}

.ap-btn-outline:hover {
	background: var(--ap-border);
}

/* Info Grid Cards */
.ap-grid-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
}

.ap-info-card {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 22px;
	margin-bottom: 0;
	background: #1e293b;
}

.ap-card-icon {
	font-size: 2.2rem;
	background: rgba(255, 255, 255, 0.05);
	width: 56px;
	height: 56px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ap-card-label {
	display: block;
	font-size: 0.8rem;
	color: var(--ap-text-muted);
	text-transform: uppercase;
	font-weight: 700;
	letter-spacing: 0.5px;
	margin-bottom: 4px;
}

.ap-card-val {
	font-size: 1.4rem;
	font-weight: 800;
	color: var(--ap-text-main);
}

/* Badges */
.ap-badge {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 9999px;
	font-size: 0.8rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ap-badge-present { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.ap-badge-absent { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.4); }
.ap-badge-half-day { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.ap-badge-leave { background: rgba(139, 92, 246, 0.2); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.4); }
.ap-badge-pending { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.ap-badge-approved { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.ap-badge-rejected { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.4); }
.ap-badge-type { background: rgba(6, 182, 212, 0.2); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.4); }

/* Total Leave Hero Card */
.ap-section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

.ap-year-tag {
	font-size: 0.85rem;
	color: #a5b4fc;
	background: rgba(99, 102, 241, 0.15);
	padding: 4px 12px;
	border-radius: 9999px;
	border: 1px solid rgba(99, 102, 241, 0.3);
}

.ap-total-leave-hero {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
	border: 1px solid #4f46e5;
	padding: 28px 36px;
	margin-bottom: 24px;
}

.ap-hero-left {
	display: flex;
	align-items: center;
	gap: 24px;
}

.ap-hero-icon {
	font-size: 3rem;
	background: rgba(255, 255, 255, 0.1);
	width: 72px;
	height: 72px;
	border-radius: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ap-hero-label {
	font-size: 0.9rem;
	color: #a5b4fc;
	text-transform: uppercase;
	font-weight: 700;
	letter-spacing: 0.5px;
}

.ap-hero-nums {
	margin-top: 4px;
}

.ap-hero-rem {
	font-size: 3rem;
	font-weight: 900;
	color: #ffffff;
}

.ap-hero-total {
	font-size: 1.1rem;
	color: #c7d2fe;
}

.ap-hero-right {
	width: 80px;
	height: 80px;
}

.circular-chart {
	display: block;
	max-width: 100%;
	max-height: 100%;
}

.circle-bg {
	fill: none;
	stroke: rgba(255, 255, 255, 0.1);
	stroke-width: 3.8;
}

.circle {
	fill: none;
	stroke: #818cf8;
	stroke-width: 3.8;
	stroke-linecap: round;
	transition: stroke-dasharray 0.6s ease 0s;
}

.percentage {
	fill: #ffffff;
	font-size: 0.5rem;
	text-anchor: middle;
	font-weight: bold;
}

/* Leave Breakdown Cards */
.ap-balance-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 18px;
	margin-bottom: 28px;
}

.ap-balance-card {
	background: #1e293b;
	border-radius: var(--ap-radius);
	padding: 20px;
	border: 1px solid var(--ap-card-border);
	box-shadow: var(--ap-shadow-sm);
}

.ap-bal-type {
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--ap-text-muted);
	margin-bottom: 10px;
}

.ap-bal-rem {
	font-size: 2rem;
	font-weight: 900;
	color: #818cf8;
}

.ap-bal-total {
	font-size: 0.9rem;
	color: var(--ap-text-muted);
}

.ap-bal-progress-bg {
	height: 6px;
	background: #334155;
	border-radius: 9999px;
	margin-top: 12px;
	overflow: hidden;
}

.ap-bal-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #6366f1, #818cf8);
	border-radius: 9999px;
}

/* Form Styles */
.ap-form-group {
	margin-bottom: 22px;
}

.ap-form-group label {
	display: block;
	font-weight: 700;
	font-size: 0.9rem;
	margin-bottom: 8px;
	color: var(--ap-text-main);
}

.ap-form-group input,
.ap-form-group select,
.ap-form-group textarea {
	width: 100%;
	padding: 12px 16px;
	border-radius: 10px;
	border: 1px solid var(--ap-border);
	background: #0f172a;
	color: var(--ap-text-main);
	font-size: 0.95rem;
	box-sizing: border-box;
}

.ap-form-group input:focus,
.ap-form-group select:focus,
.ap-form-group textarea:focus {
	border-color: var(--ap-primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.ap-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

/* Tables */
.ap-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
}

.ap-table th,
.ap-table td {
	padding: 14px 18px;
	border-bottom: 1px solid var(--ap-border);
}

.ap-table th {
	background: #0f172a;
	font-size: 0.8rem;
	font-weight: 800;
	color: var(--ap-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ap-table td {
	font-size: 0.95rem;
}

.ap-empty {
	text-align: center;
	padding: 36px;
	color: var(--ap-text-muted);
}

/* Login Box */
.ap-login-box {
	max-width: 440px;
	margin: 40px auto;
	background: var(--ap-card-bg);
	padding: 36px;
	border-radius: var(--ap-radius);
	box-shadow: var(--ap-shadow-lg);
	border: 1px solid var(--ap-card-border);
	color: var(--ap-text-main);
}

.ap-login-header {
	text-align: center;
	margin-bottom: 28px;
}

.ap-login-icon {
	width: 64px;
	height: 64px;
	background: rgba(99, 102, 241, 0.2);
	color: var(--ap-primary);
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 14px;
}
