/* Custom-styled controls (not native). IE11 compatible. */

/* === Custom checkbox === */
.cc-checkbox {
    display: inline-block;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    line-height: 20px;
    margin-right: 18px;
    margin-bottom: 6px;
}
.cc-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0; height: 0;
}
.cc-checkbox .cc-box {
    position: absolute;
    left: 0; top: 0;
    width: 20px; height: 20px;
    background: #fff;
    border: 1px solid #b0bac4;
    border-radius: 3px;
}
.cc-checkbox:hover .cc-box { border-color: #1976d2; }
.cc-checkbox input:checked + .cc-box {
    background: #1976d2;
    border-color: #1565c0;
}
.cc-checkbox input:checked + .cc-box:after {
    content: "";
    position: absolute;
    left: 6px; top: 2px;
    width: 5px; height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
}
.cc-checkbox input:disabled + .cc-box { background: #e0e6ed; }

/* === Custom radio === */
.cc-radio {
    display: inline-block;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    line-height: 20px;
    margin-right: 18px;
    margin-bottom: 6px;
}
.cc-radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0; height: 0;
}
.cc-radio .cc-circle {
    position: absolute;
    left: 0; top: 0;
    width: 20px; height: 20px;
    background: #fff;
    border: 1px solid #b0bac4;
    border-radius: 50%;
}
.cc-radio:hover .cc-circle { border-color: #1976d2; }
.cc-radio input:checked + .cc-circle {
    border-color: #1565c0;
}
.cc-radio input:checked + .cc-circle:after {
    content: "";
    position: absolute;
    left: 5px; top: 5px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #1976d2;
}

/* === Custom toggle switch === */
.cc-switch {
    display: inline-block;
    position: relative;
    width: 44px; height: 22px;
    vertical-align: middle;
    margin-right: 10px;
}
.cc-switch input {
    opacity: 0;
    width: 0; height: 0;
}
.cc-switch .cc-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #b0bac4;
    border-radius: 22px;
    -webkit-transition: background 0.2s;
    transition: background 0.2s;
}
.cc-switch .cc-slider:before {
    content: "";
    position: absolute;
    height: 18px; width: 18px;
    left: 2px; top: 2px;
    background: #fff;
    border-radius: 50%;
    -webkit-transition: left 0.2s;
    transition: left 0.2s;
}
.cc-switch input:checked + .cc-slider { background: #1976d2; }
.cc-switch input:checked + .cc-slider:before { left: 24px; }

/* === Custom select (dropdown) === */
.cc-select {
    display: inline-block;
    position: relative;
    width: 100%;
}
.cc-select .cc-select-display {
    background: #fff;
    border: 1px solid #b0bac4;
    border-radius: 3px;
    padding: 6px 28px 6px 10px;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    min-height: 18px;
}
.cc-select.open .cc-select-display { border-color: #1976d2; }
.cc-select .cc-select-display:after {
    content: "";
    position: absolute;
    right: 10px; top: 50%;
    width: 0; height: 0;
    margin-top: -3px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #5a6877;
}
.cc-select .cc-select-options {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border: 1px solid #b0bac4;
    border-radius: 3px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.cc-select.open .cc-select-options { display: block; }
.cc-select .cc-select-option {
    padding: 8px 10px;
    cursor: pointer;
}
.cc-select .cc-select-option:hover { background: #e3f2fd; }
.cc-select .cc-select-option.selected { background: #1976d2; color: #fff; }

/* === Custom input === */
.cc-input {
    background: #fff;
    border: none;
    border-bottom: 2px solid #b0bac4;
    padding: 8px 4px;
    width: 100%;
    font-size: 14px;
    font-family: inherit;
    border-radius: 0;
}
.cc-input:focus {
    outline: none;
    border-bottom-color: #1976d2;
}

/* === Custom date picker === */
.cc-datepicker {
    position: relative;
    display: inline-block;
    width: 100%;
}
.cc-datepicker-display {
    background: #fff;
    border: 1px solid #b0bac4;
    border-radius: 3px;
    padding: 6px 28px 6px 10px;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.cc-datepicker-display:after {
    content: "[cal]";
    position: absolute;
    right: 8px; top: 50%;
    margin-top: -9px;
    font-size: 11px;
    color: #5a6877;
}
.cc-datepicker.open .cc-datepicker-display { border-color: #1976d2; }
.cc-datepicker-popup {
    display: none;
    position: absolute;
    top: 100%; left: 0;
    background: #fff;
    border: 1px solid #b0bac4;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 60;
    padding: 10px;
    min-width: 260px;
}
.cc-datepicker.open .cc-datepicker-popup { display: block; }

.cc-datepicker-header {
    text-align: center;
    margin-bottom: 8px;
    font-weight: bold;
    position: relative;
    padding: 0 30px;
}
.cc-datepicker-header .nav-btn {
    position: absolute;
    top: 0;
    cursor: pointer;
    padding: 0 6px;
    color: #1976d2;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.cc-datepicker-header .nav-prev { left: 0; }
.cc-datepicker-header .nav-next { right: 0; }

.cc-datepicker-grid { width: 100%; border-collapse: collapse; }
.cc-datepicker-grid th, .cc-datepicker-grid td {
    width: 14.28%;
    text-align: center;
    padding: 4px 0;
    font-size: 12px;
    cursor: pointer;
}
.cc-datepicker-grid th { color: #8a99ab; font-weight: normal; cursor: default; }
.cc-datepicker-grid td:hover { background: #e3f2fd; }
.cc-datepicker-grid td.other-month { color: #c8d1da; }
.cc-datepicker-grid td.today { font-weight: bold; color: #1976d2; }
.cc-datepicker-grid td.selected { background: #1976d2; color: #fff; }

/* === Custom modal === */
.modal-root {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
}
.modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(31,45,61,0.55);
}
.modal-window {
    position: relative;
    width: 480px;
    max-width: 90%;
    margin: 80px auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.modal-header {
    background: #1f2d3d;
    color: #fff;
    padding: 10px 14px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    position: relative;
    font-weight: bold;
}
.modal-close {
    position: absolute;
    top: 6px; right: 8px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    width: 24px; height: 24px;
    line-height: 18px;
    padding: 0;
}
.modal-close:hover { color: #ef5350; }
.modal-body { padding: 14px; }
.modal-footer {
    padding: 10px 14px;
    background: #f5f7fa;
    border-top: 1px solid #e0e6ed;
    text-align: right;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}
.modal-footer .btn { margin-left: 6px; }

/* === Custom toast === */
.toast-root {
    position: fixed;
    top: 70px;
    right: 16px;
    z-index: 1100;
    width: 320px;
    max-width: 90%;
}
.toast {
    background: #2a3b50;
    color: #fff;
    padding: 12px 36px 12px 14px;
    border-radius: 4px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    position: relative;
    border-left: 4px solid #4fc3f7;
}
.toast.toast-success { border-left-color: #43a047; }
.toast.toast-warning { border-left-color: #fb8c00; }
.toast.toast-danger  { border-left-color: #e53935; }
.toast .toast-close {
    position: absolute;
    top: 6px; right: 8px;
    cursor: pointer;
    color: #c8d1da;
}
.toast .toast-close:hover { color: #fff; }

/* === Custom alert banner === */
.cc-alert {
    padding: 10px 36px 10px 14px;
    border-radius: 3px;
    margin-bottom: 12px;
    position: relative;
    background: #e3f2fd;
    color: #0d47a1;
    border-left: 4px solid #1976d2;
}
.cc-alert .cc-alert-close {
    position: absolute;
    top: 6px; right: 8px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    background: transparent;
    border: none;
    font-size: 16px;
}
.cc-alert .cc-alert-close:hover { opacity: 1; }
.cc-alert.cc-alert-success { background: #e8f5e9; color: #1b5e20; border-color: #43a047; }
.cc-alert.cc-alert-warning { background: #fff8e1; color: #e65100; border-color: #fb8c00; }
.cc-alert.cc-alert-danger  { background: #ffebee; color: #b71c1c; border-color: #e53935; }

/* === Custom range slider === */
.cc-range {
    position: relative;
    width: 100%;
    height: 24px;
    background: transparent;
}
.cc-range .cc-range-track {
    position: absolute;
    top: 11px;
    left: 0; right: 0;
    height: 4px;
    background: #c8d1da;
    border-radius: 2px;
}
.cc-range .cc-range-fill {
    position: absolute;
    top: 11px;
    left: 0;
    height: 4px;
    background: #1976d2;
    border-radius: 2px;
}
.cc-range .cc-range-thumb {
    position: absolute;
    top: 4px;
    width: 18px; height: 18px;
    background: #fff;
    border: 2px solid #1976d2;
    border-radius: 50%;
    margin-left: -9px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
