/* ------------------------------
 テーブル
------------------------------- */
.acms-table {
	width: 100%;
	max-width: 100%;
	border-top: $acms-table-border;
	// データ
	th,
	td {
		padding: $acms-table-cell-padding;
		vertical-align: top;
		border-bottom: $acms-table-border;
	}
	th {
		vertical-align: top;
		text-align: left;
	}
	// ボーダーなし 上
	 &.acms-table-none {
		border-top: 0;
	}
	// ボーダーなし 下
	 &.acms-table-none th,
	 &.acms-table-none td {
		border-bottom: 0;
	}
}

.panel-body .acms-table {
	th,
	td {
		padding: 5px;
	}
	.acms-table-container{
		padding: 10px 5px;
	}
}

.acms-table,
.acms-table:before,
.acms-table:after,
.acms-table-admin-edit,
.acms-table-admin-edit th,
.acms-table-admin-edit td,
.acms-table-heading,
.acms-table-heading th,
.acms-table-heading td,
.acms-admin-mini-table,
.acms-admin-mini-table tr,
.acms-admin-mini-table th,
.acms-admin-mini-table td {
	@include box-sizing(border-box);
}




// ---------------
// テーブル 見出し
// ---------------
.acms-table-heading {
	border-top: $acms-table-heading-border;
	// データ
	th,
	td {
		border-bottom: $acms-table-heading-border;
	}
	// 見出し
	th {
		padding: $acms-table-heading-th-padding;
		border-top: $acms-table-heading-th-border;
		background-color: $acms-table-heading-th-bg;
		color: $acms-table-heading-th-text-color;
		font-weight: normal;
	}
}




// ---------------
// テーブル ボーダー
// ---------------
.acms-table-bordered {
	border-top: $acms-table-bordered-border;
	border-left: $acms-table-bordered-border;
	th,
	td {
		border-bottom: $acms-table-bordered-border;
		border-right: $acms-table-bordered-border;
	}
}




// ---------------
// テーブル striped
// ---------------
.acms-table-striped{
	tr:nth-of-type(odd),
	tr.odd {
		background: $acms-table-border-odd;
	}
	tr:nth-of-type(even),
	tr.even {
		background: $acms-table-border-even;
	}
}




// ---------------
// テーブル hover
// ---------------
.acms-table-hover tr:hover td {
	background: $acms-table-hover-bg;
	cursor: pointer;
}

.acms-table-hover-line tr:hover {
	background: $acms-table-hover-line-bg;
}




// ---------------
// テーブル 入力テーブル
// ---------------
.acms-table-edit{
	border-top: none;
	th,
	td{
		vertical-align: middle;
	}
	th{
		text-align: right;
	}
}
@media screen and (max-width: $breakpoint-md-max) {
	.acms-table-admin-edit {

		thead,
		tbody {
			th,
			td {
				display: block;
				width: 100% !important;
				padding: 0;
			}
		}

		tbody {
			th {
				padding: 10px 10px 5px;
				text-align: left;
			}
			td {
				padding: 0 10px 15px;
			}
		}

		tr:last-child {
			td,
			th{
				border-bottom: none !important;
			}
		}

	}
}



// ---------------
// テーブル 入れ替え
// ---------------
.acms-table-sortable-active {
	th,
	td,
	tr:nth-of-type(even) th,
	tr:nth-of-type(even) td,
	tr.even th,
	tr.even td{
		background-color: $acms-table-sortable-bg;
	}
}

@media (max-width : $breakpoint-md-max) {
	// ---------------
	// テーブル レスポンシブ
	// ---------------
	.acms-table-responsive {
		margin-bottom: 15px;
		overflow-x: scroll;
		overflow-y: hidden;
		border: 1px solid #dddddd;
		-webkit-overflow-scrolling: touch;
		th,td {
			white-space: nowrap;
		}
	}

	// ---------------
	// テーブル entry
	// ---------------
	.acms-table-entry{
		th,
		td{
			display: block;
			width: 100%;
			padding-left: 0;
			padding-right: 0;
			@include box-sizing(border-box);
		}
		th{
			padding-bottom: 0;
			text-align: left;
		}
		td{
			padding-top: 3px;
		}
		.detail-fade-body th,
		.detail-fade-body td{
			padding-left: 10px;
			padding-right: 10px;
		}
	}
}




// ---------------
// テーブル 管理画面
// ---------------
.acms-table-admin {
	width: 100%;
	border-top: $acms-table-admin-border;
	border-right: $acms-table-admin-border;
	border-left: $acms-table-admin-border;
	// 見出し
	thead {
		border: none;
	}
	thead th {
		padding: 5px;
		@include font-size(13);
		font-weight: bold;
	}
	th,
	td {
		padding: $acms-table-admin-cell;
		border-bottom: $acms-table-admin-border;
		line-height: 1.3;
	}
	th {
		text-align: left;
	}
	td{
		background-color: $acms-table-admin-td-bg;
	}
}



// ---------------
// テーブル 管理画面 striped
// ---------------
.acms-table-admin-striped{
	tr:nth-of-type(odd),
	tr.odd {
		background: $acms-table-admin-border-odd;
	}
	tr:nth-of-type(even),
	tr.even {
		background: $acms-table-admin-border-even;
	}
}




// ---------------
// テーブル 編集画面
// ---------------
.acms-table-admin-edit {
	width: 100%;
	border-top: $acms-table-admin-edit-border;
	background: $acms-table-admin-edit-bg;
	tr {
		border-right: $acms-table-admin-edit-border;
		border-bottom: $acms-table-admin-edit-border;
		border-left: $acms-table-admin-edit-border;
	}
	th {
		width: $acms-table-admin-edit-th-width;
		font-weight: bold;
		text-align: right;
		vertical-align: top;
		 &.acms-table-nowrap {
			width: 1%;
		}
	}
	td,
	th{
		padding: 5px 10px
	}
	tr:first-child td {
		padding: 5px 10px 15px;
	}
	tr:first-child th{
		padding: 10px 10px 5px;
	}
	tr:last-child {
		td,
		th{
			padding: 5px 10px 20px;
			border-bottom: $acms-table-admin-edit-border;
		}
	}
	tr:only-child {
		td,
		th {
			padding: 10px;
			border-bottom: $acms-table-admin-edit-border;
		}
	}
	thead tr:last-child {
		td,
		th{
			padding: 5px 10px 5px;
			border-bottom: $acms-table-admin-edit-border;
		}
	}
	tbody tr:last-child th {
		padding: 10px 10px 5px;
		border-bottom: $acms-table-admin-edit-border;
	}
	tr:last-child td{
		padding: 5px 10px 15px;
		border-bottom: $acms-table-admin-edit-border;
	}
	tfoot tr:last-child {
		td,
		th{
			padding: 5px 10px 20px;
			border-bottom: $acms-table-admin-edit-border;
		}
	}

	// 下階層のtableは線なし
	table {
		width: 100%;
		th,
		td,
		tr,
		tr:first-child th,
		tr:first-child td,
		tr:last-child th,
		tr:last-child td {
			padding: 5px 10px !important;
			border: none !important;
		}
	}

	@media (min-width : $breakpoint-md-min) {
		tr {
			border-bottom: 0;
		}
		tr:first-child {
			th,td{
				padding: 20px 10px 5px;
			}
		}
		tbody tr:last-child th,
		tr:last-child th,
		tr:last-child td {
			padding: 5px 10px 20px;
		}

		tbody tr:only-child th,
		tr:only-child th,
		tr:only-child td {
			padding: 10px;
		}
	}
}

// タブの直下の編集画面テーブル
.acms-tabs-panel {
	.acms-table-admin-edit {
		border: 0;
		tr {
			border: 0;
			 &:last-child {
				th,
				td {
					border: 0;
				}
			}
		}
	}
	.acms-table-admin-edit-bordered {
		tr {
			border-bottom: $acms-table-admin-edit-bordered-border;
		}
		tbody {
			tr {
				&:last-child {
					border-bottom: 0;
				}
			}
		}
	}
}

.acms-table-admin-edit-bordered {
	width: 100%;
	border-top: $acms-table-admin-edit-bordered-border;
	background: $acms-table-admin-edit-bordered-bg;

	tr {
		border-right: $acms-table-admin-edit-bordered-border;
		border-bottom: $acms-table-admin-edit-bordered-border;
		border-left: $acms-table-admin-edit-bordered-border;
	}

	th {
		max-width: $acms-table-admin-edit-bordered-th-width;
		font-weight: bold;
		text-align: right;
		vertical-align: top;
	}

	td,
	th {
		padding: 5px 10px;
	}
	tr:first-child {
		th{
			padding-top: 10px;
		}
		td {
			padding-bottom: 15px;
		}
	}
	tr:last-child {
		th{
			padding-bottom: 10px;
			border-bottom: $acms-table-admin-edit-bordered-border;
		}
		td {
			padding-bottom: 15px;
			border-bottom: $acms-table-admin-edit-bordered-border;
		}
	}
	thead tr:last-child {
		th,td {
			border-bottom: $acms-table-admin-edit-bordered-border;
		}
	}
	tbody tr:last-child,
	tfoot tr:last-child {
		th,
		td {
			padding-bottom: 10px;
			border-bottom: $acms-table-admin-edit-bordered-border;
		}
	}

	// 下階層のtableは線なし
	table {
		th,
		td,
		tr,
		tr:first-child th,
		tr:first-child td,
		tr:last-child th,
		tr:last-child td {
			padding: 5px 10px !important;
			border: none !important;
		}
	}

	@media (min-width : $breakpoint-md-min) {
		tr:first-child td{
			padding-top: 10px;
			padding-bottom: 5px;
		}
		tr:last-child th,
		tr:last-child td{
			padding-bottom: 5px;
			padding-bottom: 10px;
		}
	}
}
// IE8
.acms-table-admin-edit table tr{
	border: none\9;
}




// ---------------
// テーブル ミニ
// ---------------
.acms-admin-mini-table {
	width: 100%;
	margin:0 0 30px 0;
	thead {
		background: $acms-admin-mini-table-thead-bg;
		border-bottom: $acms-admin-mini-table-thead-border;
	}

	tr,
	td,
	th {
		padding: 7px 10px;
	}
	th{
		text-align: left;
	}
	td{
		// 「_」は IE6対応、 「*」はIE7対応
		*border-bottom: $acms-admin-mini-table-border;
		_border-bottom: $acms-admin-mini-table-border;
	}

	tbody tr:nth-of-type(odd) td{
		background: $acms-admin-mini-table-odd;
	}

	tbody tr:nth-of-type(even) td {
		background: $acms-admin-mini-table-even;
	}
	tbody {
		border-bottom: $acms-admin-mini-table-border;
	}

	+ p{
		margin-top: -15px;
	}

	.acms-admin-mini-table-action{
		width: 80px;
	}

	.acms-admin-mini-table-import-action{
		width: 120px;
	}

	ul{
		margin-bottom: 0;
		padding-left: 1em;
	}

}

.acms-table .acms-table-action{
	width: 50px;
}




// ---------------
// テーブル カラー
// ---------------
// info
.acms-table-info {
	 & th,
	 & td,
	 &,
	.acms-table-hover  &:hover th,
	.acms-table-hover  &:hover td,
	.acms-table-hover  &:hover {
		background: $acms-table-info-bg;
	}
}

// success
.acms-table-success {
	 & th,
	 & td,
	 &,
	.acms-table-hover  &:hover th,
	.acms-table-hover  &:hover td,
	.acms-table-hover  &:hover {
		background: $acms-table-success-bg;
	}
}

// warning
.acms-table-warning {
	 & th,
	 & td,
	 &,
	.acms-table-hover  &:hover th,
	.acms-table-hover  &:hover td,
	.acms-table-hover  &:hover {
		background: $acms-table-warning-bg;
	}
}

// danger
.acms-table-danger {
	 & th,
	 & td,
	 &,
	.acms-table-hover  &:hover th,
	.acms-table-hover  &:hover td,
	.acms-table-hover  &:hover {
		background: $acms-table-danger-bg;
	}
}




// ---------------
// ユーティリティ
// ---------------
// 中央揃い
.acms-table-admin-edit .acms-table-center,
.acms-table-admin .acms-table-center,
.acms-table-center{
	text-align: center;
}

// 左揃い
.acms-table-admin-edit .acms-table-left,
.acms-table-admin .acms-table-left,
.acms-table-left{
	text-align: left;
}

// 折り返し禁止
.acms-table-nowrap {
	width: 1%;
	white-space: nowrap;
}
