/*
|   =========================================================
|   InvoicePlane
|   Sass Stylesheet
|   =========================================================
*/

/*
|   =========================================================
|   Variables
|   =========================================================
*/
$color_grey: #999999;
$color_blue: #3A87AD;
$color_yellow: #F89406;
$color_green: #468847;
$color_red: #B94A48;

$color_status_draft: #999999;
$color_status_sent: #3A87AD;
$color_status_viewed: #F89406;
$color_status_paid_approved: #468847;
$color_status_rejected_overdue: #B94A48;
$color_status_canceled: #333333;

/*
|   =========================================================
|   Import Bootstrap and other assets
|   =========================================================
*/
// Bootstrap
@import "bootstrap/bootstrap";

// Font: Font-Awesome
@import "fonts/font-awesome/font-awesome";

// Import Source Sans Font
@import "fonts/source-sans-pro";

@import "includes/select2/select2";
@import "includes/bootstrap-datepicker";
@import "includes/dropzone";
@import "includes/upload";

/*
|   =========================================================
|   Base Styles
|   =========================================================
*/

html {
    height: 100%;
    -webkit-font-smoothing: subpixel-antialiased;
    overflow-y: scroll;
}

body {
    background-color: #fff;
    font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
    font-size: 15px;
}

img {
    vertical-align: middle;
}

a:hover, a:active, a:focus {
    outline: 0;
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background-color: #eaeaea;
    border-left: 1px solid #ccc;
}

::-webkit-scrollbar-thumb {
    background-color: #ccc;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #aaa;
}

body *:focus {
    outline: none !important;
    border-color: #aaa !important;
    box-shadow: none !important;
}

.form-control, .panel {
    box-shadow: none;
}

/*
|   =========================================================
|   Forms
|   =========================================================
*/

form {
    margin: 0;
}

fieldset {
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    -ms-border-radius: 5px;
    -o-border-radius: 5px;
    border-radius: 5px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    padding: 20px;
}

fieldset legend {
    padding: 0 20px;
    font-size: 16px;
    width: auto;
    border: none;
    margin: 0;
}

label {
    margin-right: 10px;
    font-weight: normal;
}

textarea {
    margin-bottom: 20px;
    resize: vertical;
    cursor: text !important;
}

.discount-field {
    float: right;
    max-width: 40%;
    margin-left: 10px;
    .input-sm {
        height: auto;
        padding: 3px 5px;
    }
    .input-group-addon {
        min-width: 20px;
    }
}

.optional {
    float: right;
    font-size: small;
    color: $color_grey;
}

/*
|   =========================================================
|   Tables
|   =========================================================
*/

.table {
    margin: 0 0 15px;

    &.no-margin {
        margin: 0 0 0 0;
    }

    tr {
        background: #fff;
    }
    td {
        vertical-align: middle !important;
    }

    th:first-child,
    td:first-child {
        padding-left: 20px;
    }

    tr.bold-border td {
        border-bottom-width: 2px;
    }

    &.items td {
        min-width: 150px;
        max-width: 300px;
        vertical-align: top !important;
        &.td-icon {
            max-width: 30px;
            min-width: unset;
        }
        &.td-amount {
            max-width: 200px;
            text-align: right;
            .form-control {
                text-align: right;
                font-size: 12px;
            }
        }
        &.td-textarea {
            min-width: 300px;
            max-width: 400px;
        }
        &.td-quantity {
            max-width: 200px;
        }
        &.td-vert-middle {
            vertical-align: middle !important;
        }
    }

    .input-group {
        width: 100%;
        height: 100%;
    }
    .input-group-addon {
        font-size: 12px;
        padding: 4px 8px;
    }
}

.table-responsive {
    height: 100%;
    margin-bottom: 0;
}

/*
|   =========================================================
|   Navigation
|   =========================================================
*/
.navbar {
    margin: 0;
    border-radius: 0;
}

.navbar.navbar-inverse {

    .navbar-collapse {
        padding-left: 0;
        padding-right: 0;
    }

    .navbar-toggle {
        padding: 6px 8px;
        color: #ddd;
        border-color: #333;
        &:hover {
            color: #eee;
            border-color: #444;
        }
    }

    .navbar-form {
        margin-left: 0;
        margin-right: 0;
    }
}

.navbar-inner {
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    border-radius: 0;
    padding: 0;
    border: none;
    text-align: right;
}

.navbar-search {
    margin-top: 0;
}

// Options Dropdown
.options {
    margin: 0;

    .dropdown-menu {
        right: 0;
        left: auto;
    }
}

#submenu {
    font-size: 85%;
    max-width: 100% !important;

    .submenu-row {
        padding: 5px;
    }

    .nav-pills {
        > li > a {
            padding: 5px 10px;
        }
    }
}

/*
|   =========================================================
|   Pagination
|   =========================================================
*/

.pagination {
    height: auto;
    margin: 0;
}

.pagination ul > li > a,
.pagination ul > li > span {
    padding: 3px 10px;
    line-height: 20px;
}

/*
|   =========================================================
|   Sidebar
|   =========================================================
*/

.sidebar {
    display: table-cell;
    vertical-align: top;
    width: 66px;
    height: 100%;
    padding: 0;

    ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    li a {
        padding: 15px 20px;
        display: block;
        border-bottom: 1px solid #ddd;
        font-size: 20px;
        color: #666;
        text-align: center;

        &:hover {
            color: $color_blue;
        }
    }

}

/*
|   =========================================================
|   Content
|   =========================================================
*/

.alert {
    margin-left: 15px;
    margin-right: 15px;
}

.alert.alert-default {
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
}

.tab-content .alert {
    margin-left: 0;
    margin-right: 0;
}

#form-settings .tab-content,
div.table-content {
    height: 100%;

    .tab-pane {
        padding-bottom: 50px;
    }
}

#filter_results {
    height: 100%;
}

#panel-overdue-invoices,
#panel-recent-quotes,
#panel-recent-invoices {
    .panel-body {
        padding: 0;
    }
    table {
        td:first-child,
        th:first-child {
            padding-left: 10px;
        }
    }
}

#panel-overdue-invoices p {
    margin: 15px;
}

.quick-actions .btn {
    border: none;
    border-right: 1px solid #ddd;
    &:last-child {
        border-right: none;
    }
}

.fa {
    min-width: 15px;
    text-align: center;
}

.fa.fa-margin {
    margin-right: 7px;
}

.fa-credit-invoice {
    &:before {
        content: '-';
    }
    &:after {
        font-family: FontAwesome;
        content: '\f155';
    }
}

.fa-read-only {
    @extend .fa-ban;
}

.cursor-pointer {
    cursor: pointer;
}

.cursor-move {
    cursor: move;
}

#main-area {
    display: table-cell;
    width: 100%;
    padding: 0;
    border-left: 1px solid #ddd;
}

#content {
    padding: 20px;

    &.table-content {
        padding: 0;
    }
    .alert {
        margin-right: 0;
        margin-left: 0;
    }
}

.tab-content {
    @extend #content;
}

.modal-open {
    padding-right: 0 !important;
}

#headerbar {
    height: 46px;
    padding: 8px;
    border-bottom: 1px solid #ddd;

    h1 {
        font-size: 15px;
        line-height: 30px;
        margin: 0;
        float: left;
    }

    .nav {
        margin-bottom: 0;
        font-size: 12px;
        line-height: 1.5;

        li a {
            padding: 6px 12px;
        }
    }

    .pull-right {
        margin-left: 15px;
    }
}

.hidden-sidebar #main-area {
    display: block !important;
    .headerbar {
        padding: 8px 15px;
    }
}

.modal {
    margin-top: 40px;
    overflow-y: auto;
}

.modal-backdrop.in {
    background: transparent;
}

.details-box {
    @extend .panel;
    @extend .panel-default;
    @extend .panel-body;
    padding: 10px;

    .has-feedback .form-control-feedback {
        bottom: 0;
        top: auto;
        right: 0;
    }
}

#email_template_pdf_template > option {
    display: none;
}

#settings-tabs > li.active:first-child > a {
    border-left: 0 !important;
}

.updatecheck-results {
    margin: 10px 0;
}

#ipnews-loading {
    margin-top: 15px;
}

#ipnews-results .alert {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#fullpage-loader {
    z-index: 99999;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    .loader-content {
        position: absolute;
        top: 20%;
        left: 0;
        font-size: 200px;
        opacity: 0.85;
        width: 100%;
        text-align: center;
        #loader-error {
            font-size: 20px;
        }
    }
}

// Dropzone / Attachments
#actions {
    margin: 15px 0;
}

/*
|   =========================================================
|   Tabs
|   =========================================================
*/

.tabbable .table {
    margin-bottom: 20px;
}

.tabs-below .nav-tabs {
    margin: 0;
    border: 0;
    list-style: none;
    background-color: #444;
    color: #ccc;
    height: 40px;
    width: 100%;
}

.tabs-below .nav-tabs > li {
    margin-top: 0;
}

.tabs-below .nav-tabs > li > a {
    border: transparent;
    color: #ccc;
    margin-right: 0;
    padding: 10px 20px 11px;
    display: block;
    line-height: 19px;
}

.tabs-below .nav-tabs > li > a:hover,
.tabs-below .nav-tabs .active > a,
.tabs-below .nav-tabs .active > a:hover {
    border-radius: 0;
    background-color: #444;
    color: #fff;
    text-decoration: none;
    border: none;
}

.tabs-below .nav-tabs > li:first-child > a,
.tabs-below .nav-tabs > li:first-child > a:hover {
    border-left: none !important;
}

/*
|   =========================================================
|   Widgets
|   =========================================================
*/

.widget {
    border: 1px solid #ddd;
    margin-top: 20px;

    .widget-title {
        padding: 8px 20px;
        overflow: hidden;

        h5 {
            float: left;
        }

        h5 i {
            margin-right: 10px;
        }
    }

    .content-padding {
        padding: 20px;
    }
}

// Invoices and Quotes Overview
.overview table {

    th, td {
        border: none;
    }

    th {
        text-transform: uppercase;
        font-weight: normal;
        font-size: 11px;
        padding-bottom: 0;
    }

    td {
        font-size: 16px;
        font-weight: bold;
        padding-top: 4px;
    }

}

// Recent Activity
.time {
    font-size: 11px;
}

// Recent News
.post h4 {
    font-size: 14px;
}

.post-date {
    @extend .time;
    color: #bbb;
}

/*
|   =========================================================
|   Client Profile
|   =========================================================
*/

.profile {
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    -ms-border-radius: 5px;
    -o-border-radius: 5px;
    border-radius: 5px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    overflow: hidden;
    padding-bottom: 40px;

    .primaryInfo {
        padding: 20px 46px 0;
    }

    dl {
        clear: both;
        margin-top: 40px;
    }

    dl dt {
        margin: 40px 0 20px;
        border-top: 1px solid #ddd;
        line-height: 0;
    }

    dl dt span {
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        -ms-border-radius: 5px;
        -o-border-radius: 5px;
        border-radius: 5px;
        background: #fff;
        border: 1px solid #ddd;
        padding: 2px 25px;
        margin-left: 20px;
    }

    dl dd {
        clear: both;
        line-height: 20px;
        padding-top: 6px;
        margin: 0;
    }

    dl dd span {
        font-weight: bold;
        float: left;
        text-align: right;
        width: 70px;
        margin-right: 10px;
    }
}

.notes textarea {
    resize: both;
    width: 100%;
}

/*
|   =========================================================
|   Invoice and Quotes Global Styles
|   =========================================================
*/

// Invoices and Quotes Status Colors
.draft {
    color: $color_status_draft;
}

.sent {
    color: $color_status_sent;
}

.viewed {
    color: $color_status_viewed;
}

.paid,
.approved {
    color: $color_status_paid_approved;
}

.rejected,
.overdue {
    color: $color_status_rejected_overdue;
}

.canceled {
    color: $color_status_canceled;
}

// Invoices and Quotes Status
.label {

    font-weight: normal;
    padding: .3em .6em;
    color: white !important; // override status text color on labels
    display: block;
    width: 100%;

    &.label-inline {
        display: inline;
        width: auto;
    }

    &.draft {
        background-color: lighten($color_status_draft, 10%);
    }
    &.sent {
        background-color: lighten($color_status_sent, 10%);
    }
    &.viewed {
        background-color: lighten($color_status_viewed, 10%);
    }
    &.paid,
    &.approved {
        background-color: lighten($color_status_paid_approved, 10%);
    }
    &.rejected,
    &.overdue {
        background-color: lighten($color_status_rejected_overdue, 10%);
    }
    &.canceled {
        background-color: lighten($color_status_canceled, 10%);
    }

}

#item_table {
    td, th {
        padding: 5px;
    }
    .form-control {
        margin: 0;
    }
    tr.item {
        input, textarea {
            border-color: #e5e5e5;
            border-radius: 0;
            box-shadow: none;
        }
    }
}

/*
|   =========================================================
|   Quotes
|   =========================================================
*/

.quote .cf {
    margin-bottom: 40px;

    .quote-properties {
        margin-bottom: 5px;
        label {
            margin: 0;
        }
        &:last-child {
            margin-bottom: 0;
        }
    }
}

/*
|   =========================================================
|   Invoices
|   =========================================================
*/

.invoice {
    .total td:first-child,
    .total:hover td:first-child {
        background: none !important;
    }

    .total td:last-child {
        border-left: none;
    }

    .subtotal, .tax, .total,
    th.align-right, td.align-right {
        text-align: right;
    }

    .tax {
        background: none;
    }

    .invoice-properties {
        margin-bottom: 5px;
        label {
            margin: 0;
        }
        &:last-child {
            margin-bottom: 0;
        }
    }
}

.invoice-labels {
    span.label {
        float: left;
        width: auto;
        margin: 6px 3px 4px 0;
        &:last-child {
            margin-right: 0;
        }
    }
}

/*
|   =========================================================
|   Various Styles
|   =========================================================
*/

.amount {
    text-align: right;
}

.no-border-radius {
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    border-radius: 0;
}

.no-margin {
    margin: 0 !important;
}

.no-padding {
    padding: 0 !important;
}

.index-options {
    margin-bottom: 0px;
}

.padded {
    padding: 15px 0;
}

legend, .install-step h2 {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    border-color: -moz-use-text-color -moz-use-text-color #E5E5E5;
    border-image: none;
    border-style: none none solid;
    border-width: 0 0 1px;
    color: #333333;
    display: block;
    font-size: 18px;
    line-height: 40px;
    margin-bottom: 20px;
    padding: 0;
    width: 100%;
}

.login-logo {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 15px;
}

.font-overdue {
    color: #B94A48;
    font-weight: bold;
}

.nav-tabs-noborder > li > a {
    border-top-right-radius: 0;
    border-top-left-radius: 0;
    border-top: 0 !important;
}

.html-tags {
    .html-tag {
        border-bottom: none;
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
    }
}

#email_template_body {
    border-top-left-radius: 0;
}

#email-template-preview {
    width: 100%;
    border: 0;
}

/*
|   =========================================================
|   Login
|   =========================================================
*/

#login {
    @extend .panel;
    @extend .panel-default;
    @extend .panel-body;

    .form-horizontal {
        margin-bottom: 20px;
    }
    .form-group {
        margin-bottom: 20px;
    }
    h1 {
        margin: 20px 0;
    }
}

#login .alert {
    margin-bottom: 20px;
}

/*
|   =========================================================
|   Responsive Media Queries
|   =========================================================
*/

// Styles for large devices (< lg)
@media (min-width: 992px) {

    .navbar-nav .visible-lg {
        display: inline-block !important;
    }

    #submenu {
        .submenu-row {
            float: left;
            margin-right: 10px;
        }
    }

}

// Styles for medium devices (sm > md)
@media (max-width: 992px) {

    #submenu {
        .submenu-row {
            float: left;
            margin-right: 10px;
        }
    }

}

// Styles for  small devices (xs > sm)
@media (max-width: 768px) {

    .sidebar li a {
        padding: 7px;
    }

    #content {
        padding: 15px;
    }

    .navbar-nav {
        margin: 7px 0;
    }

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

    #submenu .navbar-collapse {
        margin-top: 7px;
    }

}

// Styles for very small devices (< xs)
@media (max-width: 480px) {

    .navbar-nav {
        margin: 7px 0;
        .dropdown .dropdown-menu {
            background: #555;
        }
        .visible-xs {
            display: inline-block !important;
        }
    }

    #content {
        padding: 10px;
        .row {
            margin-left: -10px;
            margin-right: -10px;
        }
    }

    .headerbar {
        padding: 8px !important;
    }

    .pull-right {
        margin-left: 5px !important;
    }

    #fullpage-loader .loader-content {
        font-size: 150px;
        top: 10%;
        left: 0;
        margin-top: 0;
        margin-left: 0;
    }
}