/**
 * Attendance Manager Admin Styles CSS
 */

/**
 *	Today's staff
 */
/*	== Modified by ao ==
	Card grid: 2 columns on mobile / 3 columns on PC.
	Photos fill the card edge-to-edge (no inner whitespace).
	NOTE: layout-critical properties use !important so that
	old theme "additional CSS" written for v0.7.x (flex layout,
	fixed li width, img max-width) can not break this grid. */
ul.staff_block.attmgr_card_grid {
	display: grid !important;
	grid-template-columns: repeat(2, 1fr) !important;
	gap: 12px !important;
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
	box-sizing: border-box;
}
@media screen and (min-width: 768px) {
	ul.staff_block.attmgr_card_grid {
		grid-template-columns: repeat(3, 1fr) !important;
		gap: 16px !important;
	}
}
ul.staff_block.attmgr_card_grid::before,
ul.staff_block.attmgr_card_grid::after {
	content: none !important;
}
ul.staff_block.attmgr_card_grid li.attmgr_card {
	float: none !important;
	width: 100% !important;
	min-width: 0 !important;
	max-width: none !important;
	list-style: none;
	margin: 0 !important;
	padding: 0 !important;
	text-align: center;
	border: 1px solid #eee;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	box-sizing: border-box;
}
ul.staff_block.attmgr_card_grid li.attmgr_card .thumb {
	margin: 0 !important;
	padding: 0 !important;
	line-height: 0;
}
ul.staff_block.attmgr_card_grid li.attmgr_card .thumb a {
	display: block;
	line-height: 0;
}
ul.staff_block.attmgr_card_grid li.attmgr_card .thumb img {
	display: block !important;
	width: 100% !important;
	max-width: none !important;
	height: auto !important;
	margin: 0 !important;
	aspect-ratio: 3 / 4 !important;
	object-fit: cover !important;
	object-position: center top;
	border-radius: 0 !important;
	box-shadow: none;
}
ul.staff_block.attmgr_card_grid li.attmgr_card .post-info {
	padding: 8px 6px 10px;
	font-size: 1em;
	line-height: 1.5;
}
ul.staff_block.attmgr_card_grid li.attmgr_card .post-info .name {
	font-weight: bold;
	font-size: 1.05em;
	white-space: normal;
}
ul.staff_block.attmgr_card_grid li.attmgr_card .post-info .name .age {
	margin-left: 4px;
	font-weight: normal;
	font-size: 0.85em;
	color: #666;
	white-space: nowrap;
}
ul.staff_block.attmgr_card_grid li.attmgr_card .post-info .style {
	margin-top: 2px;
	font-size: 0.78em;
	color: #777;
	letter-spacing: 0.02em;
	white-space: normal;
}
ul.staff_block.attmgr_card_grid li.attmgr_card .post-info .attendance {
	margin-top: 4px;
	font-size: 0.9em;
	white-space: nowrap;
}

/*	Fallback for legacy markup without .attmgr_card_grid */
ul.staff_block {
	margin: 0;
	padding: 0;
}
ul.staff_block li {
	list-style: none;
}
ul.staff_block li img {
	box-shadow: none;
}

/**
 *	Weekly schedule (attmgr_weekly_all)
 *	== Modified by ao (v1.1.0) ==
 *	- Integrated from theme "Additional CSS" into the plugin.
 *	- No line breaks inside cells; table grows to content width.
 *	- Overflow is handled by horizontal scroll (.attmgr_scroll).
 *	- Cast column is sticky on the left while scrolling.
 *	- Selectors are written both bare and with .post_content prefix
 *	  so they win against SWELL's .post_content table rules
 *	  regardless of stylesheet load order.
 */
table.attmgr_weekly_all,
.post_content table.attmgr_weekly_all {
	width: auto;
	min-width: 100%;
	margin: 0;
	table-layout: auto;			/* fixed layout causes overflow with equal columns */
	border-collapse: separate !important;	/* keep borders visible on sticky column */
	border-spacing: 0;
	border: none;
}

/* ---- cells ---- */
table.attmgr_weekly_all th,
table.attmgr_weekly_all td,
.post_content table.attmgr_weekly_all th,
.post_content table.attmgr_weekly_all td {
	width: auto;
	padding: 10px 12px;
	border: none !important;
	border-right: 1px solid #ddd !important;
	border-bottom: 1px solid #ddd !important;
	text-align: center;
	vertical-align: middle !important;
	white-space: nowrap;		/* never wrap inside a cell */
	word-break: keep-all;
	font-size: 0.92em;
	background-clip: padding-box;
}

/* avoid double lines on the outer edge (.attmgr_scroll owns the frame) */
table.attmgr_weekly_all tr:last-child td,
.post_content table.attmgr_weekly_all tr:last-child td {
	border-bottom: none !important;
}
table.attmgr_weekly_all th:last-child,
table.attmgr_weekly_all td:last-child,
.post_content table.attmgr_weekly_all th:last-child,
.post_content table.attmgr_weekly_all td:last-child {
	border-right: none !important;
}

/* ---- header row ---- */
table.attmgr_weekly_all th,
.post_content table.attmgr_weekly_all th {
	background: #f4f5f9;
	font-weight: 600;
}
table.attmgr_weekly_all th.saturday,
.post_content table.attmgr_weekly_all th.saturday {
	background: #eef6ff;
	color: #06c;
}
table.attmgr_weekly_all th.sunday,
.post_content table.attmgr_weekly_all th.sunday {
	background: #ffeef6;
	color: #c06;
}
table.attmgr_weekly_all th .date,
table.attmgr_weekly_all th .dow,
.post_content table.attmgr_weekly_all th .date,
.post_content table.attmgr_weekly_all th .dow {
	display: inline-block;
	line-height: 1.4;
}
table.attmgr_weekly_all .date {
	font-size: 0.9em;
}
table.attmgr_weekly_all .dow {
	margin-left: 5px;
	font-size: 0.8em;
}

/* ---- date cells: keep "13:00~翌08:00" on one line ---- */
table.attmgr_weekly_all td:not(.portrait),
.post_content table.attmgr_weekly_all td:not(.portrait) {
	min-width: 8em;
}

/* ---- cast column (sticky left) ---- */
table.attmgr_weekly_all th:first-child,
table.attmgr_weekly_all td.portrait,
.post_content table.attmgr_weekly_all th:first-child,
.post_content table.attmgr_weekly_all td.portrait {
	position: sticky;
	left: 0;
	z-index: 2;
	min-width: 100px;
	max-width: 130px;
	padding: 12px 10px;
	background: #fff;
	text-align: center;
	border-right: 2px solid #ccc !important;	/* emphasize the fixed-column edge */
}
table.attmgr_weekly_all th:first-child,
.post_content table.attmgr_weekly_all th:first-child {
	background: #f4f5f9;
	z-index: 3;
}

/* cast photo and name */
.attmgr_weekly_all .portrait a {
	display: block;
	margin: 0 auto;
	text-decoration: none;
	line-height: 1.4;
}
.attmgr_weekly_all .portrait img {
	display: block;
	width: 72px;
	height: auto;
	margin: 0 auto 6px !important;
	border-radius: 6px;
	aspect-ratio: 9 / 16;
	object-fit: cover;
	object-position: center top;
}

/* ---- working / day-off cells ---- */
table.attmgr_weekly_all td.working,
.post_content table.attmgr_weekly_all td.working {
	background: #fff;
}
table.attmgr_weekly_all td.not_working,
.post_content table.attmgr_weekly_all td.not_working {
	background: #f6f6f6;
	color: #999;
}

/* ---- mobile ---- */
@media screen and (max-width: 599px) {
	table.attmgr_weekly_all th,
	table.attmgr_weekly_all td,
	.post_content table.attmgr_weekly_all th,
	.post_content table.attmgr_weekly_all td {
		padding: 8px 10px;
		font-size: 12px;
	}
	table.attmgr_weekly_all th:first-child,
	table.attmgr_weekly_all td.portrait,
	.post_content table.attmgr_weekly_all th:first-child,
	.post_content table.attmgr_weekly_all td.portrait {
		min-width: 88px;
		max-width: 100px;
	}
	.attmgr_weekly_all .portrait img {
		width: 60px;
	}
	table.attmgr_weekly_all td:not(.portrait),
	.post_content table.attmgr_weekly_all td:not(.portrait) {
		min-width: 7.5em;
	}
}

/**
 *	Weekly personal schedule
 */
table.attmgr_weekly {
	width: 100%;
	border-collapse: collapse !important;
	border: 1px solid #ddd;
}
table.attmgr_weekly th,
table.attmgr_weekly td {
	width: 14.2%;
	padding: 5px auto;
	vertical-align: middle !important;
	text-align: center;
	border: 1px solid #ddd !important;
}
table.attmgr_weekly .date {
	font-size: 0.9em;
}
table.attmgr_weekly .dow {
	margin-left: 5px;
	font-size: 0.8em;
}
table.attmgr_weekly td.working {

}
table.attmgr_weekly td.not_working {
	background-color: #f6f6f6;
}

/**
 *	Scheduler for admin
 */
form#attmgr_admin_scheduler {
	clear: both;
}
form#attmgr_admin_scheduler table.attmgr_admin_scheduler {
	width: 100%;
	border-collapse: collapse !important;
	border: 1px solid #ddd;
}
form#attmgr_admin_scheduler table.attmgr_admin_scheduler th,
form#attmgr_admin_scheduler table.attmgr_admin_scheduler td {
	width: 12.5%;
	padding: 5px auto;
	vertical-align: middle !important;
	text-align: center;
	border: 1px solid #ddd !important;
	line-height: 1.5em;
}
form#attmgr_admin_scheduler table.attmgr_admin_scheduler td.portrait img {
	width: 50px;
	margin: 8px;
}
form#attmgr_admin_scheduler table.attmgr_admin_scheduler td select {
	margin-bottom: 3px;
}

/**
 *	Scheduler for staff
 */
form#attmgr_staff_scheduler {
	clear: both;
}
form#attmgr_staff_scheduler .portrait {
	float: left;
	width: 80px;
	margin-right: 10px;
}
form#attmgr_staff_scheduler .portrait img {
	width: 60px;
	margin: 10px;
}
form#attmgr_staff_scheduler .profile {
	float: left;
}
table.attmgr_staff_scheduler {
	clear: both;
}

/*
 *	Calendar
 */
table.attmgr_calendar {
	width: 100%;
	border-collapse: collapse !important;
}
table.attmgr_calendar th,
table.attmgr_calendar td {
	padding: 0 !important;
	text-align: center;
	border: 1px solid #ddd !important;
}
table.attmgr_calendar th.sunday {
	background-color: #ffeef6;
	color: #c06;
}
table.attmgr_calendar th.saturday {
	background-color: #eef6ff;
	color: #06c;
}
table.attmgr_calendar td.today {
	background-color: #ffeecc;
}
table.attmgr_calendar_weekly td .wmonth {
	font-size: x-small;
	color: #999;
}

/**
 *	Monthly schedule
 */
table.attmgr_monthly_schedule {
	background-color: #fff;
}
table.attmgr_monthly_schedule th,
table.attmgr_monthly_schedule td {
	width: 14%;
}
table.attmgr_monthly_schedule th {

}
table.attmgr_monthly_schedule td {
	vertical-align: top;
}
table.attmgr_monthly_schedule td:first-child:before {
	display: block;
	float: left;
	height: 42px;
	content: "";
}

/* .day */
table.attmgr_monthly_schedule td .day {
	text-align: center;
}
table.attmgr_monthly_schedule td .day a {
	display: block;
}
table.attmgr_monthly_schedule td:hover {

}

/* .info */
table.attmgr_monthly_schedule td .info {
	border-top: 1px dotted #ddd;
}
table.attmgr_monthly_schedule td .info div {
	text-align: left;
	line-height: 1.3em;
}
table.attmgr_monthly_schedule td .info a {
	display: block;
	padding: 3px 10px;
}

/* .saturday */ 
table.attmgr_monthly_schedule th.saturday {
	background-color: #eef6ff;
	color: #06c;
}

/* .sunday */ 
table.attmgr_monthly_schedule th.sunday {
	background-color: #ffeef6;
	color: #c06;
}

/**
 *	Weekly guide
 */
table.attmgr_guide_weekly {
	width: 100%;
	margin-bottom: 15px;
	border-collapse: collapse !important;
	border: 1px solid #ddd;
}
table.attmgr_guide_weekly td {
	width: 12.5%;
	padding: 5px auto;
	vertical-align: middle !important;
	text-align: center;
	border: 1px solid #ddd !important;
}
table.attmgr_guide_weekly td.current {
	background-color: #f0f6ff;
}
table.attmgr_guide_weekly td a {
	display: block;
	padding: 8px auto !important;
	text-decoration: none;
}
table.attmgr_guide_weekly .date {
	font-size: 0.9em;
}
table.attmgr_guide_weekly .dow {
	margin-left: 5px;
	font-size: 0.8em;
}

/*
 *	Page navi
 */
.list_pagenavi {
	display: block;
	height: 1em;
}
.list_pagenavi:after {
	content: "";
	clear: both;
	height: 0;
	display: block;
	visibility: hidden;
}
.list_pagenavi .prev_page {
	float: left;
	width: 20%;
}
.list_pagenavi .next_page {
	float: right;
	width: 20%;
	text-align: right;
}
.list_pagenavi .list_datenavi {
	float: left;
	width: 60%;
	text-align: center;
}
.list_pagenavi .list_datenavi a {
	margin: auto 10px;
}
.list_pagenavi .back_today {
	font-size: x-small;
}

/*
 *	info box
 */
.alert {
	clear: both;
	padding: 8px 35px 8px 14px;
	margin-top: 10px;
	margin-bottom: 20px;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
	background-color: transparent;
	border: 1px solid #ddd;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
}

.alert h4 {
	margin: 0;
}

.alert .close {
	position: relative;
	top: -2px;
	right: -21px;
	line-height: 20px;
}

.alert-caution {
	color: #c09853;
	background-color: #fcf8e3;
	border: 1px solid #fbeed5;
}
.alert-caution h4 {
	color: #c09853;
}

.alert-success {
	color: #468847;
	background-color: #dff0d8;
	border-color: #d6e9c6;
}

.alert-success h4 {
	color: #468847;
}

.alert-danger,
.alert-error {
	color: #b94a48;
	background-color: #f2dede;
	border-color: #eed3d7;
}

.alert-danger h4,
.alert-error h4 {
	color: #b94a48;
}

.alert-info {
	color: #3a87ad;
	background-color: #d9edf7;
	border-color: #bce8f1;
}

.alert-info h4 {
	color: #3a87ad;
}

.alert-block {
	padding-top: 14px;
	padding-bottom: 14px;
}

.alert-block > p,
.alert-block > ul {
	margin-bottom: 0;
}

.alert-block p + p {
	margin-top: 5px;
}

/*
 *	Mobile
 */
@media screen and (max-width: 480px) {
	table.attmgr_guide_weekly th,
	table.attmgr_guide_weekly td,
	table.attmgr_monthly_schedule th,
	table.attmgr_monthly_schedule td,
	table.attmgr_admin_scheduler th,
	table.attmgr_admin_scheduler td,
	table.attmgr_weekly th,
	table.attmgr_weekly td {
		padding: 3px 0;
		font-size: x-small;
		font-weight: normal;
	}
	/* NOTE: attmgr_weekly_all is handled by its own 599px block above (v1.1.0) */
	table.attmgr_guide_weekly .date,
	table.attmgr_guide_weekly .dow,
	table.attmgr_monthly_schedule .date,
	table.attmgr_monthly_schedule .dow,
	table.attmgr_admin_scheduler .date,
	table.attmgr_admin_scheduler .dow,
	table.attmgr_weekly .date,
	table.attmgr_weekly .dow,
	table.attmgr_weekly_all .date,
	table.attmgr_weekly_all .dow {
		display:block;
		line-height: 1.3em;
	}
	table .portrait img {
		/*
		width: auto !important;
		height: auto !important;
		*/
	}
	.list_pagenavi,
	.list_datenavi {
		font-size: x-small;
	}
}



/**
 *	== Modified by ao ==
 *	Portrait: 9:16 / original image
 */
form#attmgr_admin_scheduler table.attmgr_admin_scheduler td.portrait img,
form#attmgr_staff_scheduler .portrait img {
	aspect-ratio: 9 / 16;
	object-fit: cover;
	object-position: center top;
	height: auto;
}

/**
 *	== Modified by ao ==
 *	Horizontal scroll for schedule tables
 */
.attmgr_scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 15px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
}
.attmgr_scroll table {
	margin-bottom: 0;
}
/* weekly_all sizes itself via width:auto + min-width:100% (see above) */
.attmgr_scroll table.attmgr_weekly {
	min-width: 560px;
}
.attmgr_scroll table.attmgr_calendar,
.attmgr_scroll table.attmgr_monthly_schedule {
	min-width: 640px;
}
table.attmgr_weekly th,
table.attmgr_weekly td {
	white-space: nowrap;
}
table.attmgr_monthly_schedule td .info div {
	white-space: nowrap;
}

/**
 *	== Modified by ao ==
 *	Schedule status labels
 */
.attmgr_status {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 3px;
	font-size: 0.85em;
	line-height: 1.6;
	white-space: nowrap;
}
.attmgr_status_full {
	background-color: #fde8e8;
	color: #c0392b;
	border: 1px solid #f5c6cb;
}
.attmgr_status_inquiry {
	background-color: #fff6e0;
	color: #b07d00;
	border: 1px solid #ffe8a1;
}
.attmgr_status_dayoff {
	background-color: #f0f0f0;
	color: #888;
	border: 1px solid #ddd;
}
.attmgr_status_with_time {
	display: inline-block;
	margin-left: 4px;
}
select.attmgr_status_select {
	margin-top: 3px;
}

/**
 *	== Modified by ao (v1.1.0) ==
 *	Date navi (attmgr_guide_weekly) fine tuning
 *	Integrated from theme "Additional CSS".
 */
table.attmgr_guide_weekly td,
.post_content table.attmgr_guide_weekly td {
	padding: 8px 2px;
}
table.attmgr_guide_weekly td a,
.post_content table.attmgr_guide_weekly td a {
	display: block;
	padding: 4px 0;
}
table.attmgr_guide_weekly td.saturday a,
.post_content table.attmgr_guide_weekly td.saturday a {
	color: #06c;
}
table.attmgr_guide_weekly td.sunday a,
.post_content table.attmgr_guide_weekly td.sunday a {
	color: #c06;
}


/**
 *	== Modified by ao == (v1.3.0)
 *	Place (working location) badge & group headings
 */
.attmgr_place {
	display: inline-block;
	margin-right: 4px;
	margin-bottom: 2px;
	padding: 1px 7px;
	font-size: 0.78em;
	line-height: 1.6;
	color: #fff;
	background: #7a8ba8;
	border-radius: 3px;
	white-space: nowrap;
	vertical-align: middle;
}
/* inside the daily card, badge goes on its own line above the time */
ul.staff_block.attmgr_card_grid li.attmgr_card .attendance .attmgr_place {
	display: block;
	margin: 0 auto 3px;
	max-width: max-content;
}
.attmgr_place_group_title {
	margin: 1.4em 0 0.6em;
	padding: 4px 10px;
	font-weight: bold;
	font-size: 1.05em;
	border-left: 4px solid #7a8ba8;
	background: #f4f6f9;
	border-radius: 0 4px 4px 0;
}
.attmgr_place_group_title:first-of-type {
	margin-top: 0.4em;
}
select.attmgr_place_select {
	max-width: 100%;
}
/* weekly/monthly table cells: keep badge compact */
table[class*="attmgr"] td .attmgr_place {
	display: block;
	margin: 0 auto 2px;
	max-width: max-content;
	font-size: 0.72em;
}
