
/* xd-docs */

body.user-unauthenticated .xd-hide-unauth { display: none !important; }

.xd-dialog-class-1 {
	padding: 10px; background: #dfdedd; color: #000; border: none 1px #aaa; border-radius: 5px; box-shadow: 1px 1px 10px 0 #444;
	& h2 { margin: 1em 2px 0; font-size: 80%; font-weight: bold; color: #777; }
	& h2:first-of-type { margin-top: 0; }
}

#xd-docs-main {
	max-width: 30em; margin: 0 auto; padding-top: 2em;
}

#xd-fayt-result {
	position: absolute; z-index: 5;
	display: grid; grid: auto-flow / auto auto; gap: 2px 1px; margin-top: 3px;
	max-width: 90vw; max-height: 50vh; overflow: auto; font-size: .875rem;
	background: #ddd; border: none 1px #aaa; border-radius: 5px; box-shadow: 1px 1px 6px 0 #555;
	&:empty { display: none; }
	& > button {
		display: block; white-space: nowrap; background: white; border: none; border-radius: 0;
		&.xd-doctype-1::after { content:'doc'; float: right; text-align: center; width: 30px; background: lightblue; border-radius: 3px; }
		&.xd-doctype-2::after { content:'she'; float: right; text-align: center; width: 30px; background: lightgreen; border-radius: 3px; }
	}
	& > button[name="doc_button"] { text-align: left; min-width: 15em; }
	& > button[name="doc_opts_button"] {
		&::after { content: '\22EE'; }
	}
	& > button:focus { box-shadow: none; background: lightblue; }
}

#xd-docs-create-button { height: 2.5em; }

#xd-doc-props-dialog {
	z-index: 1; margin: 12em auto;
/*	&:not([data-cur-doc-id="0"]) > #xd-select-doctype { display:none; }*/
	& > div {
		margin-bottom: .5em;
		& > input { width: 100%; }
	}
	&[data-cur-doc-id="0"] .xd-hide-at-create { display:none; }
}

#xd-document-type-select { width: 100% }

#xd-document-owner { display: block; }

/*#xd-document-groups { margin: 8px 0; }*/
#xd-doc-groups-table {
	width: 100%; border-collapse: collapse; margin: 1em 0 4px; font-size: 80%;
	& > * > tr {
		border: solid 1px #777;
/*		& > th { color: #777; }*/
		& > * { padding: 0 5px; }
		& > *:first-child { border-right: solid 1px #777; }
	}
	& button { height: auto; padding: 0; line-height: 2; border: none; background: none; }
	& input { margin: 0; }
}
/*#xd-create-group-button { margin: 3px 0; }*/

#xd-group-dialog {
	z-index: 1; margin: 14em auto;
/*	& > h2 + div {
		display: flex; flex-flow: row wrap; gap: 8px; max-width: 25em;
		& > div { flex: 0 min-content; display: flex; flex-flow: row wrap; align-content: flex-start; gap: 2px; }
	}*/
	& button[value="add_member"] { float: left; }

	&[data-my-group-role="0"] button[value="add_member"],
	&:not([data-my-group-role="2"]) button[value="delete_group"],
	[data-group-id="0"] button[value="delete_group"] { display: none; }
}
#xd-group-name { display: block; width: 14em; }

#xd-group-member-div { height: 12em; max-height: 50vh; overflow: auto; border: solid 1px #777; }
#xd-group-member-table {
	width: max-content; font-size: 80%;
	& > thead {
		position: sticky; top: 0; background: #dfdedd;
		&::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: #777; }
	}
	& > * > tr {
		border-bottom: solid 1px #777;
		& > * { padding: 4px 8px; }
		& > *:first-child { border-right: solid 1px #777; }
		& > *:last-child { border-left: solid 1px #777; }
		& > :nth-child(n+2):nth-child(-n+5) { width: 5em; text-align: center; }
	}
/*	& > tbody > tr:last-child { border-bottom: none; }*/
}


/*********************************************************************************/
/* xish-sheets */

#xd-workbook-html {
	height: 100%; overscroll-behavior-y: contain;
	& > body {
		height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; background: white; font-size: .875rem;
		& > header {
			display: grid; grid: auto auto / 13rem 1fr; font-family: monospace; border-bottom: solid 1px #aaa;
			& > div {
				display: flex; align-items: baseline;
				& > span { padding: 0 4px; }
			}
		}
		& > main { position: relative; overflow: auto scroll; }
		& > footer { border-top: solid 1px #aaa; }
	}
}
#xish-doc-name { height: auto; border: 1px #ccc; border-style: none none solid none; }
#xish-cell-input {
	height: 1.6rem; min-height: 1.6rem; line-height: 1.5; padding-top: 3px; resize: vertical; border: 1px #ccc; border-style: none none solid solid;
	&:focus { outline: solid 2px red; outline-offset: -2px; }
}
#xish-cell-name-input { height: auto; line-height: 2; padding: 0 3px; border: none; }
#xish-cell-value-div {
	height: 1.6rem; min-height: 1.6rem; resize: vertical; overflow: hidden auto; word-break: break-word; text-overflow: ellipsis;
	padding: 0 5px; line-height: 1.5; padding-top: 3px; border-left: solid 1px #ccc;
/*	&:empty { display: none; }*/
}
#xish-sheet-tabs > button {
	background: none; border-style: none solid none none;
	&.xish-active-sheet { background: hsl(200 50% 80%); }
}

#xish-sheet-root {
	display: grid; grid-auto-flow: row; width: max-content; line-height: 1;
	& > button {
		/*width: 100%;*/
		height: 100%; overflow: hidden; line-height: 1; padding: 0 3px; text-align: left; background: white; white-space: nowrap;
		border: 1px #ddd; border-style: none solid solid none; border-radius: 0;

		&:first-child { z-index: 4; position: sticky; left: 0; top: 0; text-align: center; background: #ddd; border-color: #aaa; }
		&.xish-sheet-row { z-index: 1; position: sticky; left: 0; text-align: center; background: #ddd; border-color: #aaa; }
		&.xish-frozen-columns { position: sticky; z-index: 1; }
		&.xish-sheet-column { z-index: 2; position: sticky; top: 0; text-align: center; background: #ddd; border-color: #aaa; }
		&.xish-sheet-column.xish-frozen-columns { z-index: 3; }
		&.xish-frozen-columns-boundry { border-right-color: #777; }

		&.xish-selected-cell {
			position: relative !important; left: auto !important; top: auto !important;
			&::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: hsl(240 100 75 / .3); }
		}
		&.xish-selection-start-cell { background: #7f7; }

/*		&:focus { z-index: 1; }*/
		&.xish-focused-cell { outline: solid 2px #77f; outline-offset: -1px; }

		&.xish-number { text-align: right; }

		.xish-v-align-top { display: flex; flex-direction: column; white-space: pre-wrap; justify-content: flex-start; }
		.xish-v-align-middle { display: flex; flex-direction: column; white-space: pre-wrap; justify-content: center; }
		.xish-v-align-bottom { display: flex; flex-direction: column; white-space: pre-wrap; justify-content: flex-end; }

		.xish-h-align-left { text-align: left; }
		.xish-h-align-center { text-align: center; }
		.xish-h-align-right { text-align: right; }
	}
}


.xish-font-family-serif { font-family: serif; }
.xish-font-family-sans { font-family: sans-serif; }
.xish-font-family-mono { font-family: monospace; }
.xish-font-family-cursive { font-family: cursive; }
.xish-font-family-fantasy { font-family: fantasy; }

