/**
 * Material Dashboard Override for Bootstrap 2
 * Inspired by Google Material Design
 */

/* Core Variables & Typography */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    background-color: #f0f2f5 !important;
    color: #3c4043;
    -webkit-font-smoothing: antialiased;
}

/* Navbar (App Bar) */
.navbar-fixed-top .navbar-inner {
    background: #fff !important;
    background-image: none !important;
    border: none !important;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15) !important;
    padding: 10px 0;
}

.navbar .brand {
    color: #5f6368 !important;
    font-weight: 500;
    font-size: 22px;
    padding-top: 10px;
    padding-bottom: 10px;
    text-shadow: none !important;
}

.navbar .nav>li>a {
    color: #5f6368 !important;
    font-weight: 500;
    text-shadow: none !important;
    padding: 10px 15px;
    border-radius: 4px;
    transition: background-color 0.2s;
    margin: 0 4px;
}

.navbar .nav>li>a:hover {
    background-color: #f5f5f5 !important;
    color: #202124 !important;
}

.navbar .nav>.active>a,
.navbar .nav>.active>a:hover,
.navbar .nav>.active>a:focus {
    background-color: #e8f0fe !important;
    color: #1a73e8 !important;
    box-shadow: none !important;
}

/* Sidebar (Navigation Drawer) */
.nav-pills.nav-stacked {
    background: #fff;
    padding: 16px 0;
    border-radius: 8px;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.nav-pills.nav-stacked>li>a {
    border-radius: 0 20px 20px 0;
    margin-right: 16px;
    color: #5f6368;
    font-weight: 500;
    padding: 10px 24px;
    transition: all 0.2s;
}

.nav-pills.nav-stacked>li>a:hover {
    background-color: #f5f5f5;
    color: #202124;
}

.nav-pills.nav-stacked>.active>a,
.nav-pills.nav-stacked>.active>a:hover {
    background-color: #e8f0fe;
    color: #1a73e8;
}

/* Content Area */
.span10 {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    padding: 24px;
    min-height: 500px;
    margin-top: 5px;
    /* Adjust for grid alignment */
}

/* Tables (Material Data Table) */
.table-bordered {
    border: none;
    border-radius: 4px;
}

.table-bordered th,
.table-bordered td {
    border-left: none !important;
    border-right: none !important;
}

.table th {
    background-color: #fff;
    color: #5f6368;
    font-weight: 500;
    border-bottom: 2px solid #dadce0 !important;
    padding: 16px !important;
}

.table td {
    border-top: 1px solid #dadce0 !important;
    padding: 16px !important;
    color: #3c4043;
    vertical-align: middle;
}

.table-hover tbody tr:hover td,
.table-hover tbody tr:hover th {
    background-color: #f5f5f5 !important;
}

/* Buttons */
.btn {
    background-image: none !important;
    background-color: #fff;
    border: 1px solid #dadce0;
    box-shadow: none !important;
    color: #1a73e8;
    font-weight: 500;
    text-shadow: none !important;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn:hover {
    background-color: #f8f9fa;
    border-color: #dadce0;
    color: #174ea6;
}

.btn-primary {
    background-color: #1a73e8 !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3) !important;
}

.btn-primary:hover {
    background-color: #1557b0 !important;
    box-shadow: 0 1px 3px 1px rgba(60, 64, 67, 0.15) !important;
}

.btn-danger {
    background-color: #d93025 !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3) !important;
}

.btn-success {
    background-color: #1e8e3e !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3) !important;
}

/* Forms */
input[type="text"],
input[type="password"],
select {
    border: 1px solid #dadce0 !important;
    padding: 8px 12px;
    border-radius: 4px !important;
    box-shadow: none !important;
    transition: border-color 0.2s;
    color: #3c4043;
    height: 40px !important;
    box-sizing: border-box !important;
    line-height: normal !important;
}

textarea {
    border: 1px solid #dadce0 !important;
    padding: 8px 12px;
    border-radius: 4px !important;
    box-shadow: none !important;
    transition: border-color 0.2s;
    color: #3c4043;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #1a73e8 !important;
    box-shadow: none !important;
}

/* Input Append/Prepend (Datepicker Fixes) */
.input-append,
.input-prepend {
    display: inline-flex;
    align-items: center;
    /* Vertical alignment */
}

/* Fix width expansion and height alignment */
.input-append input[type="text"],
.input-prepend input[type="text"] {
    border-radius: 4px 0 0 4px !important;
    margin-bottom: 0;
    flex: none;
    /* Prevent width expansion */
    width: auto;
    /* Fallback to natural width or Bootstrap defaults */
    height: 40px !important;
    /* Force matching height */
    box-sizing: border-box !important;
    padding: 8px 12px;
    /* Ensure padding matches height expectation */
}

.input-append .add-on,
.input-prepend .add-on {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    /* Remove vertical padding, rely on height/flex */
    background-color: #f5f5f5;
    border: 1px solid #dadce0;
    border-left: none;
    color: #5f6368;
    text-shadow: none;
    height: 40px !important;
    /* Force matching height */
    min-width: 40px;
    /* Square-ish buttons */
    box-sizing: border-box !important;
    cursor: pointer;
}

.input-append .add-on:last-child {
    border-radius: 0 4px 4px 0;
}

.input-append .add-on i,
.input-prepend .add-on i {
    margin-top: 0;
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent !important;
    padding: 0 0 20px 0;
    margin: 0;
    border-radius: 0;
}

.breadcrumb li {
    text-shadow: none !important;
}

.breadcrumb .active {
    color: #202124;
}

.breadcrumb a {
    color: #5f6368;
}

.breadcrumb a:hover {
    color: #1a73e8;
    text-decoration: none;
}

/* Alerts */
.alert {
    border-radius: 4px;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

.alert-error {
    background-color: #fce8e6;
    color: #d93025;
}

.alert-success {
    background-color: #e6f4ea;
    color: #1e8e3e;
}

/* Pagination */
.pagination ul {
    box-shadow: none !important;
}

.pagination ul>li>a,
.pagination ul>li>span {
    border: 1px solid #dadce0;
    border-right: none;
    /* Bootstrap 2 quirk */
    color: #5f6368;
    padding: 8px 14px;
    background: #fff;
}

.pagination ul>li:last-child>a {
    border-right: 1px solid #dadce0;
    border-radius: 0 4px 4px 0;
}

.pagination ul>li:first-child>a {
    border-radius: 4px 0 0 4px;
}

.pagination ul>.active>a,
.pagination ul>.active>span {
    color: #1a73e8;
    background-color: #e8f0fe;
    border-color: #dadce0;
}

/* Bootstrap 2 Grid Fixes for Card Layout */
.container-fluid {
    padding-top: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Fix navbar offset due to padding change */
body {
    padding-top: 80px !important;
}

/* Login Page Specifics */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding-top: 0 !important;
    /* Override global padding */
}

.login-card {
    background-color: #fff;
    padding: 48px 40px 36px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo-container {
    margin-bottom: 40px;
}

.logo-container img {
    max-height: 100px;
}

.login-card .input-group {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}

.login-card .input-group input {
    width: 100%;
    padding: 13px 15px;
    font-size: 16px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border 0.2s;
    outline: none;
    color: #202124;
    height: auto !important;
}

.login-card .input-group input:focus {
    border: 2px solid #1a73e8;
    padding: 12px 14px;
}

/* Floating Label Logic */
.login-card .input-group label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #fff;
    padding: 0 5px;
    color: #5f6368;
    font-size: 16px;
    transition: 0.2s ease all;
    pointer-events: none;
}

.login-card .input-group input:focus~label,
.login-card .input-group input:not(:placeholder-shown)~label {
    top: 0;
    font-size: 12px;
    color: #1a73e8;
}

.login-card .input-group input:not(:focus):not(:placeholder-shown)~label {
    color: #5f6368;
}

.captcha-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 30px;
    text-align: left;
}

.captcha-row .input-group {
    margin-bottom: 0;
    flex-grow: 1;
}

.captcha-row img {
    border-radius: 4px;
    border: 1px solid #dadce0;
    cursor: pointer;
}

.btn-login {
    background-color: #1a73e8;
    color: #fff;
    font-weight: 500;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    transition: background-color 0.2s;
    text-shadow: none;
    height: auto;
    line-height: normal;
}

.btn-login:hover {
    background-color: #1557b0;
    color: white;
}