/* ===== SalesRep Custom Bootstrap Theme ===== */

:root {
    --sr-primary: #e8850c;
    --sr-primary-light: #f5a623;
    --sr-primary-dark: #c46e00;
    --sr-secondary: #2c3e50;
    --sr-sidebar-width: 260px;
    --sr-header-height: 56px;
}

/* ===== Global ===== */
body {
    background-color: #f4f6f9;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

a {
    text-decoration: none;
}

/* ===== Navbar ===== */
.navbar-sales {
    background: linear-gradient(135deg, var(--sr-primary), var(--sr-primary-dark));
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-height: var(--sr-header-height);
}
.navbar-sales .navbar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.navbar-sales .navbar-brand img {
    height: 36px;
    width: auto;
}
.navbar-sales .nav-link,
.navbar-sales .navbar-text {
    color: rgba(255,255,255,0.9);
}
.navbar-sales .nav-link:hover {
    color: #fff;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sr-sidebar-width);
    position: fixed;
    top: var(--sr-header-height);
    left: 0;
    bottom: 0;
    background: #fff;
    border-right: 1px solid #e2e6ea;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}
.sidebar .nav-link {
    color: #5a6270;
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar .nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}
.sidebar .nav-link:hover {
    background-color: #fff5eb;
    color: var(--sr-primary);
    border-left-color: var(--sr-primary-light);
}
.sidebar .nav-link.active {
    background-color: #fff0e0;
    color: var(--sr-primary-dark);
    border-left-color: var(--sr-primary);
    font-weight: 600;
}
.sidebar .sidebar-header {
    padding: 16px 20px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #a0a6b1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Content Area ===== */
.main-content {
    margin-left: var(--sr-sidebar-width);
    padding: 24px;
    min-height: calc(100vh - var(--sr-header-height));
}

/* ===== Cards ===== */
.card {
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-radius: 8px;
}
.card-header {
    background-color: #fff;
    border-bottom: 2px solid var(--sr-primary-light);
    font-weight: 600;
    color: var(--sr-secondary);
}

/* ===== Dashboard Cards ===== */
.dash-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.dash-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    color: inherit;
}
.dash-card .card-body {
    text-align: center;
    padding: 28px 16px;
}
.dash-card .card-body i {
    font-size: 2.4rem;
    color: var(--sr-primary);
    margin-bottom: 12px;
    display: block;
}
.dash-card .card-body h5 {
    font-weight: 600;
    margin-bottom: 4px;
}
.dash-card .card-body p {
    color: #7a8190;
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* ===== Buttons ===== */
.btn-primary {
    background-color: var(--sr-primary);
    border-color: var(--sr-primary);
}
.btn-primary:hover {
    background-color: var(--sr-primary-dark);
    border-color: var(--sr-primary-dark);
}
.btn-outline-primary {
    color: var(--sr-primary);
    border-color: var(--sr-primary);
}
.btn-outline-primary:hover {
    background-color: var(--sr-primary);
    border-color: var(--sr-primary);
}

/* ===== ASP.NET GridView as Bootstrap Table ===== */
.table-grid {
    width: 100% !important;
    border-collapse: collapse;
}
.table-grid th {
    background-color: var(--sr-secondary) !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 10px 14px !important;
    border: none !important;
}
.table-grid td {
    padding: 10px 14px !important;
    font-size: 0.88rem;
    vertical-align: middle !important;
    border-bottom: 1px solid #edf0f4 !important;
    background-color: transparent !important;
    color: #3a3f4a !important;
}
.table-grid tr:nth-child(even) td {
    background-color: #f8f9fb !important;
}
.table-grid tr:hover td {
    background-color: #fff5eb !important;
}
.table-grid td a,
.table-grid td input[type="submit"] {
    font-size: 0.85rem;
}
/* Pager row */
.table-grid tr:last-child td {
    background-color: #fff !important;
    text-align: center;
}
.table-grid tr:last-child td table {
    margin: 0 auto;
}
.table-grid tr:last-child td table td {
    padding: 4px 10px !important;
    border: none !important;
    background: transparent !important;
}
.table-grid tr:last-child td table td a,
.table-grid tr:last-child td table td span {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 500;
}
.table-grid tr:last-child td table td span {
    background-color: var(--sr-primary);
    color: #fff;
}
.table-grid tr:last-child td table td a {
    color: var(--sr-primary);
}
.table-grid tr:last-child td table td a:hover {
    background-color: #fff0e0;
}

/* GridView action buttons inside grid */
.table-grid input[type="submit"] {
    border: none;
    border-radius: 4px;
    padding: 5px 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== Form Styling ===== */
.form-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}
.form-section h5 {
    color: var(--sr-secondary);
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--sr-primary-light);
}

/* ASP.NET TextBox/DropDown overrides */
.form-section input[type="text"],
.form-section input[type="password"],
.form-section select,
.form-section textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    box-sizing: border-box;
}
.form-section input[type="text"]:focus,
.form-section input[type="password"]:focus,
.form-section select:focus {
    border-color: var(--sr-primary-light);
    box-shadow: 0 0 0 0.2rem rgba(232, 133, 12, 0.2);
    outline: none;
}

/* ASP.NET Button overrides inside forms */
.form-section input[type="submit"] {
    display: inline-block;
    padding: 8px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-save {
    background-color: var(--sr-primary) !important;
    color: #fff !important;
}
.btn-save:hover {
    background-color: var(--sr-primary-dark) !important;
}
.btn-cancel {
    background-color: #6c757d !important;
    color: #fff !important;
}
.btn-cancel:hover {
    background-color: #5a6268 !important;
}
.btn-action {
    background-color: #198754 !important;
    color: #fff !important;
}
.btn-action:hover {
    background-color: #146c43 !important;
}
.btn-search {
    background-color: var(--sr-secondary) !important;
    color: #fff !important;
}
.btn-search:hover {
    background-color: #1a252f !important;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5a623 0%, #e8850c 50%, #c46e00 100%);
}
.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}
.login-card .card-body {
    padding: 40px 36px;
}
.login-card .login-logo {
    text-align: center;
    margin-bottom: 24px;
}
.login-card .login-logo img {
    height: 80px;
    width: auto;
}
.login-card .login-title {
    text-align: center;
    font-weight: 700;
    color: var(--sr-secondary);
    margin-bottom: 28px;
    font-size: 1.3rem;
}
.login-card .input-group {
    margin-bottom: 18px;
}
.login-card .input-group-text {
    background-color: #f8f9fa;
    border-right: none;
    color: var(--sr-primary);
}
.login-card .form-control {
    border-left: none;
}
.login-card .form-control:focus {
    border-color: #ced4da;
    box-shadow: none;
}
.login-card .input-group:focus-within .input-group-text,
.login-card .input-group:focus-within .form-control {
    border-color: var(--sr-primary-light);
    box-shadow: 0 0 0 0.2rem rgba(232, 133, 12, 0.15);
}
.login-card .btn-login {
    width: 100%;
    padding: 10px;
    font-weight: 600;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--sr-primary), var(--sr-primary-dark));
    border: none;
    color: #fff;
    border-radius: 6px;
    margin-top: 8px;
    transition: opacity 0.2s;
}
.login-card .btn-login:hover {
    opacity: 0.9;
}

/* ===== No Access Page ===== */
.no-access-wrapper {
    text-align: center;
    padding: 60px 20px;
}
.no-access-wrapper img {
    max-width: 200px;
    margin-bottom: 24px;
    opacity: 0.8;
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 999;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

@media (min-width: 992px) {
    .navbar-sales .btn-sidebar-toggle {
        display: none;
    }
}
