/* ============================================================
   Content-area styling: data grids, detail views, forms, inputs
   and buttons inside .main-content. Loaded after layout.css and
   text.css; the site header, navigation and footer are untouched.

   Classes set in the markup:
     .grid     GridView (lists)
     .details  DetailsView and data FormViews (label / value rows)
   ============================================================ */

/* ---------- Base text ----------
   px rather than em so nested tables don't compound sizes. */
.main-content table,
.main-content input,
.main-content select,
.main-content textarea {
    font-family: verdana, arial, sans-serif;
    font-size: 12px;
    color: rgb(40,40,40);
}

/* Leave the AjaxControlToolkit calendar popup at its own size. */
.main-content .ajax__calendar table,
.main-content .ajax__calendar td {
    font-size: inherit;
    color: inherit;
}

/* Warning / important notices in the content area */
.main-content .warning {
    font-size: 12px;
    color: rgb(185,30,30);
}

/* ---------- Data grids (GridView) ---------- */
.main-content table.grid {
    width: 100%;
    border-collapse: collapse;
    border: 0;
    margin: 0 0 1.5em 0;
}

.main-content table.grid > tbody > tr > th,
.main-content table.grid > tbody > tr > td {
    padding: 4px 6px;
    border: 0;
    border-bottom: 1px solid rgb(225,225,225);
    vertical-align: top;
}

.main-content table.grid > tbody > tr > th {
    background: rgb(240,240,240);
    border-bottom: 1px solid rgb(200,200,200);
    color: rgb(80,80,80);
    font-weight: bold;
    text-align: left;
    white-space: nowrap;
}

.main-content table.grid > tbody > tr > th a,
.main-content table.grid > tbody > tr > th a:visited {
    color: rgb(70,122,167);
    text-decoration: none;
}

.main-content table.grid > tbody > tr > th a:hover {
    text-decoration: underline;
}

/* Row hover (not the header, the pager row or the empty-data row) */
.main-content table.grid > tbody > tr:not(.empty):not(:has(th)):not(:has(table)):hover > td {
    background: rgb(245,248,251);
}

/* Pager row: GridView renders the page numbers as a nested table */
.main-content table.grid > tbody > tr > td > table {
    border-collapse: collapse;
    margin: 2px 0;
}

.main-content table.grid > tbody > tr > td > table td {
    padding: 0 8px 0 0;
    border: 0;
}

.main-content table.grid > tbody > tr > td > table span {
    font-weight: bold;
    color: rgb(80,80,80);
}

/* ---------- Detail views (DetailsView, data FormViews) ----------
   Grids and detail views fill the width available to them: the content
   panel, or the layout cell they sit in. */
.main-content table.details {
    width: 100%;
    border-collapse: collapse;
    border: 0;
    margin: 0 0 1.5em 0;
}

/* DetailsView: rows are directly in the table.
   FormView: rows are in the template's own table inside the outer cell. */
.main-content table.details > tbody > tr > td,
.main-content table.details > tbody > tr > td > table > tbody > tr > td {
    padding: 4px 6px;
    border: 0;
    border-bottom: 1px solid rgb(235,235,235);
    vertical-align: middle;
}

/* The FormView's own outer cell is just a wrapper */
.main-content table.details > tbody > tr > td:has(> table) {
    padding: 0;
    border: 0;
}

.main-content table.details > tbody > tr > td > table {
    width: 100%;
    border-collapse: collapse;
}

/* Field labels: first column */
.main-content table.details > tbody > tr > td:first-child:not(:only-child),
.main-content table.details > tbody > tr > td > table > tbody > tr > td:first-child:not(:only-child) {
    color: rgb(100,100,100);
}

/* ---------- Empty state ----------
   Shown when a GridView, DetailsView or FormView has no data. Add
   <EmptyDataRowStyle CssClass="empty" /> to the control; works with both
   EmptyDataText and an EmptyDataTemplate. */
.main-content table > tbody > tr.empty > td,
.main-content table.grid > tbody > tr.empty > td,
.main-content table.details > tbody > tr.empty > td {
    padding: 14px 16px;
    border: 1px dashed rgb(205,205,205);
    background: rgb(248,249,250);
    color: rgb(105,105,105);
    text-align: center;
    vertical-align: middle;
}

/* An empty grid/view fills the width available to it */
.main-content table:has(> tbody > tr.empty) {
    width: 100%;
}

/* Buttons inside an empty state (e.g. "Invoice Now") sit after the text */
.main-content tr.empty .btn {
    margin-left: 10px;
}

/* ---------- Inputs ---------- */
.main-content input[type="text"],
.main-content input[type="password"],
.main-content input:not([type]),
.main-content select,
.main-content textarea {
    padding: 2px 4px;
    border: 1px solid rgb(200,200,200);
    background: rgb(255,255,255);
    vertical-align: middle;
}

.main-content select {
    padding: 1px 2px;
}

.main-content input[type="text"]:focus,
.main-content input[type="password"]:focus,
.main-content input:not([type]):focus,
.main-content select:focus,
.main-content textarea:focus {
    border-color: rgb(70,122,167);
    outline: none;
    box-shadow: 0 0 0 2px rgba(70,122,167,0.15);
}

/* Read-only fields: view-mode templates show values in disabled dropdowns/textboxes.
   Show them as plain text so they read like the other values on the page. */
.main-content input[type="text"]:disabled,
.main-content input:not([type]):disabled,
.main-content select:disabled,
.main-content textarea:disabled {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    border-color: transparent;
    padding-left: 0;
    color: rgb(40,40,40);
    opacity: 1;
}

/* ---------- Buttons ----------
   Use on every asp:Button:
     CssClass="btn"              standard action (Search, Add, Print...)
     CssClass="btn btn-primary"  the main action on a page or form (one per form)
     CssClass="btn btn-danger"   destructive action (e.g. Cancel Booking)
   Don't set Width on buttons; they size to their text.
   Unclassed buttons inside .main-content fall back to the standard look. */
.btn,
.main-content input[type="submit"]:not(.btn),
.main-content input[type="button"]:not(.btn) {
    display: inline-block;
    box-sizing: border-box;
    height: 26px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid rgb(175,175,175);
    border-radius: 3px;
    background: rgb(240,240,240) linear-gradient(rgb(252,252,252), rgb(232,232,232));
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
    color: rgb(50,50,50);
    font-family: verdana, arial, sans-serif;
    font-size: 12px;
    font-weight: normal;
    line-height: 24px;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
}

/* Space between buttons that sit side by side */
.btn + .btn {
    margin-left: 8px;
}

.btn:hover,
.main-content input[type="submit"]:not(.btn):hover,
.main-content input[type="button"]:not(.btn):hover {
    border-color: rgb(130,130,130);
    background: rgb(230,230,230) linear-gradient(rgb(255,255,255), rgb(222,222,222));
    color: rgb(20,20,20);
}

.btn:active,
.main-content input[type="submit"]:not(.btn):active,
.main-content input[type="button"]:not(.btn):active {
    background: rgb(220,220,220);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}

.btn:focus-visible,
.main-content input[type="submit"]:not(.btn):focus-visible,
.main-content input[type="button"]:not(.btn):focus-visible {
    outline: 2px solid rgba(70,122,167,0.5);
    outline-offset: 1px;
}

/* Primary: site blue, white text */
.btn.btn-primary {
    border-color: rgb(52,96,135);
    background: rgb(70,122,167) linear-gradient(rgb(90,142,188), rgb(70,122,167));
    color: rgb(255,255,255);
}

.btn.btn-primary:hover {
    border-color: rgb(40,78,112);
    background: rgb(58,108,151) linear-gradient(rgb(78,131,177), rgb(58,108,151));
    color: rgb(255,255,255);
}

.btn.btn-primary:active {
    background: rgb(55,100,140);
}

/* Danger: red outline, fills lightly on hover */
.btn.btn-danger {
    border-color: rgb(205,150,150);
    background: rgb(250,242,242) linear-gradient(rgb(255,255,255), rgb(246,234,234));
    color: rgb(165,35,35);
}

.btn.btn-danger:hover {
    border-color: rgb(165,35,35);
    background: rgb(244,224,224) linear-gradient(rgb(252,240,240), rgb(240,218,218));
    color: rgb(140,20,20);
}

.btn.btn-danger:active {
    background: rgb(236,206,206);
}

.btn:disabled,
.main-content input[type="submit"]:not(.btn):disabled,
.main-content input[type="button"]:not(.btn):disabled {
    opacity: 0.55;
    cursor: default;
    box-shadow: none;
}
