/*
    DJANGO Admin styles
*/

/* Since Django 3.2 the admin's changelists.css, forms.css and widgets.css take
   their colors from these variables, which only its own base.css defines (#104).
   Its light values; not its dark ones, since the rest of this file is light */
:root {
  --primary: #79aec8;
  --secondary: #417690;
  --accent: #f5dd5d;
  --primary-fg: #fff;

  --body-fg: #333;
  --body-bg: #fff;
  --body-quiet-color: #666;
  --body-loud-color: #000;

  --header-color: #ffc;
  --header-branding-color: var(--accent);
  --header-bg: var(--secondary);
  --header-link-color: var(--primary-fg);

  --breadcrumbs-fg: #c4dce8;
  --breadcrumbs-link-fg: var(--body-bg);
  --breadcrumbs-bg: var(--primary);

  --link-fg: #447e9b;
  --link-hover-color: #036;
  --link-selected-fg: #5b80b2;

  --hairline-color: #e8e8e8;
  --border-color: #ccc;

  --error-fg: #ba2121;

  --message-success-bg: #dfd;
  --message-warning-bg: #ffc;
  --message-error-bg: #ffefef;

  --darkened-bg: #f8f8f8;
  --selected-bg: #e4e4e4;
  --selected-row: #ffc;

  --button-fg: #fff;
  --button-bg: var(--primary);
  --button-hover-bg: #609ab6;
  --default-button-bg: var(--secondary);
  --default-button-hover-bg: #205067;
  --close-button-bg: #888;
  --close-button-hover-bg: #747474;
  --delete-button-bg: #ba2121;
  --delete-button-hover-bg: #a41515;

  --object-tools-fg: var(--button-fg);
  --object-tools-bg: var(--close-button-bg);
  --object-tools-hover-bg: var(--close-button-hover-bg);
}

body {
    margin: 0;
    padding: 0;
    font-size: 12px;
    font-family: "Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif;
    color: #333;
    background: #fff;
}

/* LINKS */

a:link, a:visited {
    color: #5b80b2;
    text-decoration: none;
}

a:hover {
    color: #036;
}

a img {
    border: none;
}

a.section:link, a.section:visited {
    color: white;
    text-decoration: none;
}

/* GLOBAL DEFAULTS */

p, ol, ul, dl {
    margin: .2em 0 .8em 0;
}

p {
    padding: 0;
    line-height: 140%;
}

h1,h2,h3,h4,h5 {
    font-weight: bold;
}

h1 {
    font-size: 18px;
    color: #666;
    padding: 0 6px 0 0;
    margin: 0 0 .2em 0;
}

h2 {
    font-size: 16px;
    margin: 1em 0 .5em 0;
}

h2.subhead {
    font-weight: normal;
    margin-top: 0;
}

h3 {
    font-size: 14px;
    margin: .8em 0 .3em 0;
    color: #666;
    font-weight: bold;
}

h4 {
    font-size: 12px;
    margin: 1em 0 .8em 0;
    padding-bottom: 3px;
}

h5 {
    font-size: 10px;
    margin: 1.5em 0 .5em 0;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

ul li {
    list-style-type: square;
    padding: 1px 0;
}

ul.plainlist {
    margin-left: 0 !important;
}

ul.plainlist li {
    list-style-type: none;
}

li ul {
    margin-bottom: 0;
}

li, dt, dd {
    font-size: 11px;
    line-height: 14px;
}

dt {
    font-weight: bold;
    margin-top: 4px;
}

dd {
    margin-left: 0;
}

form {
    margin: 0;
    padding: 0;
}

fieldset {
    margin: 0;
    padding: 0;
}

blockquote {
    font-size: 11px;
    color: #777;
    margin-left: 2px;
    padding-left: 10px;
    border-left: 5px solid #ddd;
}

code, pre {
    font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
    background: inherit;
    color: #666;
    font-size: 11px;
}

pre.literal-block {
    margin: 10px;
    background: #eee;
    padding: 6px 8px;
}

code strong {
    color: #930;
}

hr {
    clear: both;
    color: #eee;
    background-color: #eee;
    height: 1px;
    border: none;
    margin: 0;
    padding: 0;
    font-size: 1px;
    line-height: 1px;
}

/* TEXT STYLES & MODIFIERS */

.small {
    font-size: 11px;
}

.tiny {
    font-size: 10px;
}

p.tiny {
    margin-top: -2px;
}

.mini {
    font-size: 9px;
}

p.mini {
    margin-top: -3px;
}

.help, p.help {
    font-size: 10px !important;
    color: #999;
}

p img, h1 img, h2 img, h3 img, h4 img, td img {
    vertical-align: middle;
}

.quiet, a.quiet:link, a.quiet:visited {
    color: #999 !important;
    font-weight: normal !important;
}

.quiet strong {
    font-weight: bold !important;
}

.float-right {
    float: right;
}

.float-left {
    float: left;
}

.clear {
    clear: both;
}

.align-left {
    text-align: left;
}

.align-right {
    text-align: right;
}

.example {
    margin: 10px 0;
    padding: 5px 10px;
    background: #efefef;
}

.nowrap {
    white-space: nowrap;
}

/* TABLES */

table {
    border-collapse: collapse;
    border-color: #ccc;
}

td, th {
    font-size: 11px;
    line-height: 13px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
    padding: 5px;
    font-family: "Lucida Grande", Verdana, Arial, sans-serif;
}

th {
    text-align: left;
    font-size: 12px;
    font-weight: bold;
}

thead th,
tfoot td {
    color: #666;
    padding: 2px 5px;
    font-size: 11px;
    background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x;
    border-left: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

tfoot td {
    border-bottom: none;
    border-top: 1px solid #ddd;
}

thead th:first-child,
tfoot td:first-child {
    border-left: none !important;
}

thead th.optional {
    font-weight: normal !important;
}

fieldset table {
    border-right: 1px solid #eee;
}

tr.row-label td {
    font-size: 9px;
    padding-top: 2px;
    padding-bottom: 0;
    border-bottom: none;
    color: #666;
    margin-top: -1px;
}

tr.alt {
    background: #f6f6f6;
}

.row1 {
    background: #EDF3FE;
}

.row2 {
    background: white;
}

/* Django 3.1's change lists and tabular inlines no longer mark their rows with
   row1/row2 (#104): the same stripes, by position. A row the actions select
   keeps its highlight (changelists.css) */
#result_list tbody tr:nth-child(odd):not(.selected),
.tabular tbody tr.form-row:nth-child(odd) {
    background: #EDF3FE;
}

#result_list tbody tr:nth-child(even):not(.selected),
.tabular tbody tr.form-row:nth-child(even) {
    background: white;
}

/* Django 3.2's actions.js shows and hides the change list's "select all" and
   "clear selection" with this class, which only its own base.css styles (#104) */
.hidden {
    display: none;
}

/* Django 4.0 renders checkbox lists in divs, not in a ul (#104), and the admin's
   forms.css no longer keeps their labels from floating as it did in the ul
   (.aligned ul label) and indenting them (form .aligned ul): one option per
   line again, beside the field's label */
.aligned .lista-opciones label {
    display: inline;
    float: none;
    width: auto;
}

form .aligned div.lista-opciones {
    margin: 0.2em 0 0.8em 160px;
    padding: 0 10px;
}

form .aligned div.lista-opciones > div {
    padding: 1px 0;
}

/* Django 4.2 lays out the save buttons in a flex row from the left, with Save
   first (#104). Up to 4.1 they were on the right with Save last and Delete on
   the left, by floats: the same order and spacing again */
.submit-row {
    justify-content: flex-end;
    gap: 5px;
}

.submit-row input.default {
    order: 1;
    margin-left: 3px;
}

.submit-row a.deletelink {
    order: -1;
    margin-left: 0;
    margin-right: auto;
}

/* 4.2 puts each field and its label in a flex row: the input stretched to the
   label's height. Its own height, as up to 4.1 */
.aligned .flex-container {
    align-items: flex-start;
}

/* Django 5.0 draws the icons beside a related field's select (change, add,
   view) at 20px and darker, in a flex row that grows (#104). Their size, shade
   and spacing up to 4.2 */
div.related-widget-wrapper {
    display: block;
    float: left;
    overflow: hidden;
    flex-grow: 0;
    margin-bottom: 0;
}

.related-widget-wrapper a.related-widget-wrapper-link {
    opacity: 0.3;
    filter: none;
}

.related-widget-wrapper a.related-widget-wrapper-link:link {
    opacity: .8;
}

.related-widget-wrapper a.related-widget-wrapper-link:link:focus,
.related-widget-wrapper a.related-widget-wrapper-link:link:hover {
    opacity: 1;
}

.related-widget-wrapper select + a.related-widget-wrapper-link,
.related-widget-wrapper a.related-widget-wrapper-link + a.related-widget-wrapper-link {
    margin-left: 7px;
}

.related-widget-wrapper-link img {
    width: 13px;
    height: 13px;
}

/* Django 5.1 gives the headings of fieldsets and inlines a class of their own,
   drawn as a tall bar in the header's color (#104). The headings up to 5.0, as
   .module h2 above */
fieldset.module .fieldset-heading,
fieldset.module .inline-heading {
    margin: 0;
    padding: 2px 5px 3px 5px;
    border: none;
    font-size: 11px;
    text-align: left;
    font-weight: bold;
    background: #7CA0C7 url(../img/admin/default-bg.gif) top left repeat-x;
    color: white;
}

/* 5.1's forms.css no longer darkens the required fields' labels, nor gives the
   labels the line height and spacer that set each row's height; and it floats
   a checkbox's label. As up to 5.0, in the admin's own forms (.flex-container;
   the project's hand-written forms load the old forms.css instead) */
.aligned .flex-container label.required {
    color: var(--body-fg);
}

.aligned .flex-container label {
    line-height: 1;
}

.aligned .flex-container label:not(.vCheckboxLabel):after {
    height: 1.625rem;
}

.aligned .flex-container .vCheckboxLabel {
    float: none;
    width: auto;
    display: inline-block;
    vertical-align: -3px;
    padding: 0 0 5px 5px;
}

/* 5.1 paints a list's chosen options in --selected-row (yellow here); the
   browser's own grey, as up to 5.0 */
form .aligned .flex-container select option:checked {
    background-color: revert;
}

/* Django 5.2 always gives tabular inlines a delete column, empty when its rows
   can't be deleted (branch prices, a worker's branches): none, as up to 5.1.
   Not in an inline that adds rows, whose "remove" links go in that column
   (inlines.js gives the others an add-row with its cell hidden) */
.inline-group:not(:has(tr.add-row td:not([style*="none"]))) .tabular table:has(thead th:last-child:empty) thead th:last-child,
.inline-group:not(:has(tr.add-row td:not([style*="none"]))) .tabular table:has(thead th:last-child:empty) td.delete {
    display: none;
}

/* 5.2 draws a new inline row's remove icon at 1.5rem, and its "add another"
   link takes the class addlink, which this file draws with the old gif. Both
   as up to 5.1 */
.inline-group a.inline-deletelink {
    width: 16px;
    height: 16px;
    margin-bottom: 0;
    background-size: 16px 16px;
}

.inline-group div.add-row a.addlink,
.inline-group .tabular tr.add-row td a.addlink {
    padding-left: 16px;
    background: url(../../static/admin/img/icon-addlink.svg) 0 1px no-repeat;
}

/* SORTABLE TABLES */

thead th a:link, thead th a:visited {
    color: #666;
    display: block;
}

table thead th.sorted {
    background-position: bottom left !important;
}

table thead th.sorted a {
    padding-right: 13px;
}

table thead th.ascending a {
    background: url(../img/admin/arrow-down.gif) right .4em no-repeat;
}

table thead th.descending a {
    background: url(../img/admin/arrow-up.gif) right .4em no-repeat;
}

/* ORDERABLE TABLES */

table.orderable tbody tr td:hover {
    cursor: move;
}

table.orderable tbody tr td:first-child {
    padding-left: 14px;
    background-image: url(../img/admin/nav-bg-grabber.gif);
    background-repeat: repeat-y;
}

table.orderable-initalized .order-cell, body>tr>td.order-cell {
    display: none;
}

/* FORM DEFAULTS */

input, textarea, select, .form-row p {
    margin: 2px 0;
    padding: 2px 3px;
    vertical-align: middle;
    font-family: "Lucida Grande", Verdana, Arial, sans-serif;
    font-weight: normal;
    font-size: 11px;
}

textarea {
    vertical-align: top !important;
}

input[type=text], input[type=password], textarea, select, .vTextField {
    border: 1px solid #ccc;
}

/* FORM BUTTONS */

.button, input[type=submit], input[type=button], .submit-row input {
    background: white url(../img/admin/nav-bg.gif) bottom repeat-x;
    padding: 3px 5px;
    color: black;
    border: 1px solid #bbb;
    border-color: #ddd #aaa #aaa #ddd;
}

.button:active, input[type=submit]:active, input[type=button]:active {
    background-image: url(../img/admin/nav-bg-reverse.gif);
    background-position: top;
}

.button.default, input[type=submit].default, .submit-row input.default {
    border: 2px solid #5b80b2;
    background: #7CA0C7 url(../img/admin/default-bg.gif) bottom repeat-x;
    font-weight: bold;
    color: white;
    float: right;
}

.button.default:active, input[type=submit].default:active {
    background-image: url(../img/admin/default-bg-reverse.gif);
    background-position: top;
}

/* MODULES */

.module {
    border: 1px solid #ccc;
    margin-bottom: 5px;
    background: white;
}

.module p, .module ul, .module h3, .module h4, .module dl, .module pre {
    padding-left: 10px;
    padding-right: 10px;
}

.module blockquote {
    margin-left: 12px;
}

.module ul, .module ol {
    margin-left: 1.5em;
}

.module h3 {
    margin-top: .6em;
}

.module h2, .module caption, .inline-group h2 {
    margin: 0;
    padding: 2px 5px 3px 5px;
    font-size: 11px;
    text-align: left;
    font-weight: bold;
    background: #7CA0C7 url(../img/admin/default-bg.gif) top left repeat-x;
    color: white;
}

.module table {
    border-collapse: collapse;
}

/* MESSAGES & ERRORS */

ul.messagelist {
    padding: 0 0 5px 0;
    margin: 0;
}

ul.messagelist li {
    font-size: 12px;
    display: block;
    padding: 4px 5px 4px 25px;
    margin: 0 0 3px 0;
    border-bottom: 1px solid #ddd;
    color: #666;
    background: #ffc url(../img/admin/icon_success.gif) 5px .3em no-repeat;
}

.errornote {
    font-size: 12px !important;
    display: block;
    padding: 4px 5px 4px 25px;
    margin: 0 0 3px 0;
    border: 1px solid red;
    color: red;
    background: #ffc url(../img/admin/icon_error.gif) 5px .3em no-repeat;
}

ul.errorlist {
    margin: 0 !important;
    padding: 0 !important;
}

.errorlist li {
    font-size: 12px !important;
    display: block;
    padding: 4px 5px 4px 25px;
    margin: 0 0 3px 0;
    border: 1px solid red;
    color: white;
    background: red url(../img/admin/icon_alert.gif) 5px .3em no-repeat;
}

td ul.errorlist {
    margin: 0 !important;
    padding: 0 !important;
}

td ul.errorlist li {
    margin: 0 !important;
}

.errors {
    background: #ffc;
}

.errors input, .errors select {
    border: 1px solid red;
}

div.system-message {
    background: #ffc;
    margin: 10px;
    padding: 6px 8px;
    font-size: .8em;
}

div.system-message p.system-message-title {
    padding: 4px 5px 4px 25px;
    margin: 0;
    color: red;
    background: #ffc url(../img/admin/icon_error.gif) 5px .3em no-repeat;
}

.description {
    font-size: 12px;
    padding: 5px 0 0 12px;
}

/* BREADCRUMBS */

div.breadcrumbs {
    background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x;
    padding: 2px 8px 3px 8px;
    font-size: 11px;
    color: #999;
    border-top: 1px solid white;
    border-bottom: 1px solid #ccc;
    text-align: left;
}

/* ACTION ICONS */

.addlink {
    padding-left: 12px;
    background: url(../img/admin/icon_addlink.gif) 0 .2em no-repeat;
}

.changelink {
    padding-left: 12px;
    background: url(../img/admin/icon_changelink.gif) 0 .2em no-repeat;
}

.deletelink {
    padding-left: 12px;
    background: url(../img/admin/icon_deletelink.gif) 0 .25em no-repeat;
}

a.deletelink:link, a.deletelink:visited {
    color: #CC3434;
}

a.deletelink:hover {
    color: #993333;
}

/* OBJECT TOOLS */

.object-tools {
    font-size: 10px;
    font-weight: bold;
    font-family: Arial,Helvetica,sans-serif;
    padding-left: 0;
    float: right;
    position: relative;
    margin-top: -2.4em;
    margin-bottom: -2em;
}

.form-row .object-tools {
    margin-top: 5px;
    margin-bottom: 5px;
    float: none;
    height: 2em;
    padding-left: 3.5em;
}

.object-tools li {
    display: block;
    float: left;
    background: url(../img/admin/tool-left.gif) 0 0 no-repeat;
    padding: 0 0 0 8px;
    margin-left: 2px;
    height: 16px;
}

.object-tools li:hover {
    background: url(../img/admin/tool-left_over.gif) 0 0 no-repeat;
}

.object-tools a:link, .object-tools a:visited {
    display: block;
    float: left;
    color: white;
    padding: .1em 14px .1em 8px;
    height: 14px;
    background: #999 url(../img/admin/tool-right.gif) 100% 0 no-repeat;
}

.object-tools a:hover, .object-tools li:hover a {
    background: #5b80b2 url(../img/admin/tool-right_over.gif) 100% 0 no-repeat;
}

.object-tools a.viewsitelink, .object-tools a.golink {
    background: #999 url(../img/admin/tooltag-arrowright.gif) top right no-repeat;
    padding-right: 28px;
}

.object-tools a.viewsitelink:hover, .object-tools a.golink:hover {
    background: #5b80b2 url(../img/admin/tooltag-arrowright_over.gif) top right no-repeat;
}

.object-tools a.addlink {
    background: #999 url(../img/admin/tooltag-add.gif) top right no-repeat;
    padding-right: 28px;
}

.object-tools a.addlink:hover {
    background: #5b80b2 url(../img/admin/tooltag-add_over.gif) top right no-repeat;
}

/* OBJECT HISTORY */

table#change-history {
    width: 100%;
}

table#change-history tbody th {
    width: 16em;
}

/* PAGE STRUCTURE */

#container {
    position: relative;
    width: 100%;
    min-width: 760px;
    padding: 0;
}

#content {
    margin: 10px 15px;
}

#header {
    width: 100%;
}

#content-main {
    float: left;
    width: 100%;
}

#content-related {
    float: right;
    width: 18em;
    position: relative;
    margin-right: -19em;
}

#footer {
    clear: both;
    padding: 10px;
}

/* COLUMN TYPES */

.colMS {
    margin-right: 20em !important;
}

.colSM {
    margin-left: 20em !important;
}

.colSM #content-related {
    float: left;
    margin-right: 0;
    margin-left: -19em;
}

.colSM #content-main {
    float: right;
}

.popup .colM {
    width: 95%;
}

.subcol {
    float: left;
    width: 46%;
    margin-right: 15px;
}

.dashboard #content {
    width: 500px;
}

/* HEADER */

#header {
    background: #417690;
    color: #ffc;
    overflow: hidden;
}

#header a:link, #header a:visited {
    color: white;
}

#header a:hover {
    text-decoration: underline;
}

#branding h1 {
    padding: 0 10px;
    font-size: 18px;
    margin: 8px 0;
    font-weight: normal;
    color: #f4f379;
}

#branding h2 {
    padding: 0 10px;
    font-size: 14px;
    margin: -8px 0 8px 0;
    font-weight: normal;
    color: #ffc;
}

#user-tools {
    position: absolute;
    top: 0;
    right: 0;
    padding: 1.2em 10px;
    font-size: 11px;
    text-align: right;
}

/* SIDEBAR */

#content-related h3 {
    font-size: 12px;
    color: #666;
    margin-bottom: 3px;
}

#content-related h4 {
    font-size: 11px;
}

#content-related .module h2 {
    background: #eee url(../img/admin/nav-bg.gif) bottom left repeat-x;
    color: #666;
}

.pedidos{
    background: url("../img/admin/nav-bg-reverse.gif") repeat-x scroll 0 -10px white;
    border-bottom: 1px solid #DDDDDD;
    border-top: 1px solid #FFFFFF;
    color: #999999;
    padding: 3px;
    }
    
.pedidos label{
    font-size: 11px;
    margin-left: 0.5em;
    }
